openc3-cosmos-tool-docs 5.15.2 → 5.16.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +4 -4
  2. data/tools/staticdocs/404.html +3 -3
  3. data/tools/staticdocs/assets/css/styles.a9c55efa.css +1 -0
  4. data/tools/staticdocs/assets/js/22b3ac48.299bf4d6.js +1 -0
  5. data/tools/staticdocs/assets/js/411898ad.f103f64b.js +1 -0
  6. data/tools/staticdocs/assets/js/6831b732.bbf2813b.js +1 -0
  7. data/tools/staticdocs/assets/js/{aa6b6c1b.6281c551.js → aa6b6c1b.a13cb467.js} +1 -1
  8. data/tools/staticdocs/assets/js/b6d70f94.20a403bf.js +1 -0
  9. data/tools/staticdocs/assets/js/f15615f1.534d50e4.js +1 -0
  10. data/tools/staticdocs/assets/js/{main.bb0229c9.js → main.9ed8621d.js} +2 -2
  11. data/tools/staticdocs/assets/js/{runtime~main.fb053c0b.js → runtime~main.c6bb8b5e.js} +1 -1
  12. data/tools/staticdocs/docs/configuration/command.html +3 -3
  13. data/tools/staticdocs/docs/configuration/format.html +3 -3
  14. data/tools/staticdocs/docs/configuration/interfaces.html +3 -3
  15. data/tools/staticdocs/docs/configuration/plugins.html +7 -4
  16. data/tools/staticdocs/docs/configuration/protocols.html +14 -6
  17. data/tools/staticdocs/docs/configuration/ssl-tls.html +3 -3
  18. data/tools/staticdocs/docs/configuration/table.html +3 -3
  19. data/tools/staticdocs/docs/configuration/target.html +3 -3
  20. data/tools/staticdocs/docs/configuration/telemetry-screens.html +3 -3
  21. data/tools/staticdocs/docs/configuration/telemetry.html +7 -4
  22. data/tools/staticdocs/docs/configuration.html +3 -3
  23. data/tools/staticdocs/docs/development/curl.html +90 -4
  24. data/tools/staticdocs/docs/development/developing.html +3 -3
  25. data/tools/staticdocs/docs/development/host-install.html +3 -3
  26. data/tools/staticdocs/docs/development/json-api.html +3 -3
  27. data/tools/staticdocs/docs/development/log-structure.html +3 -3
  28. data/tools/staticdocs/docs/development/roadmap.html +3 -3
  29. data/tools/staticdocs/docs/development/streaming-api.html +3 -3
  30. data/tools/staticdocs/docs/development/testing.html +3 -3
  31. data/tools/staticdocs/docs/development.html +3 -3
  32. data/tools/staticdocs/docs/getting-started/generators.html +3 -3
  33. data/tools/staticdocs/docs/getting-started/gettingstarted.html +3 -3
  34. data/tools/staticdocs/docs/getting-started/installation.html +3 -3
  35. data/tools/staticdocs/docs/getting-started/key_concepts.html +3 -3
  36. data/tools/staticdocs/docs/getting-started/podman.html +3 -3
  37. data/tools/staticdocs/docs/getting-started/requirements.html +3 -3
  38. data/tools/staticdocs/docs/getting-started/upgrading.html +3 -3
  39. data/tools/staticdocs/docs/getting-started.html +3 -3
  40. data/tools/staticdocs/docs/guides/bridges.html +3 -3
  41. data/tools/staticdocs/docs/guides/cfs.html +3 -3
  42. data/tools/staticdocs/docs/guides/custom-widgets.html +3 -3
  43. data/tools/staticdocs/docs/guides/little-endian-bitfields.html +3 -3
  44. data/tools/staticdocs/docs/guides/local-mode.html +3 -3
  45. data/tools/staticdocs/docs/guides/logging.html +3 -3
  46. data/tools/staticdocs/docs/guides/monitoring.html +3 -3
  47. data/tools/staticdocs/docs/guides/performance.html +3 -3
  48. data/tools/staticdocs/docs/guides/raspberrypi.html +14 -13
  49. data/tools/staticdocs/docs/guides/script-writing.html +3 -3
  50. data/tools/staticdocs/docs/guides/scripting-api.html +45 -37
  51. data/tools/staticdocs/docs/guides.html +3 -3
  52. data/tools/staticdocs/docs/meta/contributing.html +3 -3
  53. data/tools/staticdocs/docs/meta/licenses.html +3 -3
  54. data/tools/staticdocs/docs/meta/philosophy.html +3 -3
  55. data/tools/staticdocs/docs/meta/xtce.html +3 -3
  56. data/tools/staticdocs/docs/meta.html +3 -3
  57. data/tools/staticdocs/docs/privacy.html +3 -3
  58. data/tools/staticdocs/docs/tools/autonomic.html +3 -3
  59. data/tools/staticdocs/docs/tools/bucket-explorer.html +3 -3
  60. data/tools/staticdocs/docs/tools/calendar.html +3 -3
  61. data/tools/staticdocs/docs/tools/cmd-sender.html +3 -3
  62. data/tools/staticdocs/docs/tools/cmd-tlm-server.html +3 -3
  63. data/tools/staticdocs/docs/tools/data-extractor.html +3 -3
  64. data/tools/staticdocs/docs/tools/data-viewer.html +3 -3
  65. data/tools/staticdocs/docs/tools/handbooks.html +3 -3
  66. data/tools/staticdocs/docs/tools/limits-monitor.html +3 -3
  67. data/tools/staticdocs/docs/tools/packet-viewer.html +3 -3
  68. data/tools/staticdocs/docs/tools/script-runner.html +3 -3
  69. data/tools/staticdocs/docs/tools/table-manager.html +3 -3
  70. data/tools/staticdocs/docs/tools/tlm-grapher.html +3 -3
  71. data/tools/staticdocs/docs/tools/tlm-viewer.html +3 -3
  72. data/tools/staticdocs/docs/tools.html +3 -3
  73. data/tools/staticdocs/docs.html +3 -3
  74. data/tools/staticdocs/index.html +3 -3
  75. data/tools/staticdocs/lunr-index-1714800805056.json +1 -0
  76. data/tools/staticdocs/lunr-index.json +1 -1
  77. data/tools/staticdocs/markdown-page.html +3 -3
  78. data/tools/staticdocs/search-doc-1714800805056.json +1 -0
  79. data/tools/staticdocs/search-doc.json +1 -1
  80. metadata +14 -14
  81. data/tools/staticdocs/assets/css/styles.a4426211.css +0 -1
  82. data/tools/staticdocs/assets/js/22b3ac48.77516494.js +0 -1
  83. data/tools/staticdocs/assets/js/411898ad.e29e2db3.js +0 -1
  84. data/tools/staticdocs/assets/js/6831b732.a77e4761.js +0 -1
  85. data/tools/staticdocs/assets/js/b6d70f94.66d95cb7.js +0 -1
  86. data/tools/staticdocs/assets/js/f15615f1.0b19ae07.js +0 -1
  87. data/tools/staticdocs/lunr-index-1711942080429.json +0 -1
  88. data/tools/staticdocs/search-doc-1711942080429.json +0 -1
  89. /data/tools/staticdocs/assets/js/{main.bb0229c9.js.LICENSE.txt → main.9ed8621d.js.LICENSE.txt} +0 -0
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[9005],{1292:(e,t,n)=>{n.r(t),n.d(t,{assets:()=>d,contentTitle:()=>i,default:()=>h,frontMatter:()=>a,metadata:()=>o,toc:()=>c});var r=n(1085),s=n(1184);const a={sidebar_position:7,title:"Protocols"},i=void 0,o={id:"configuration/protocols",title:"Protocols",description:"Protocols process data on behalf of an Interface. They can modify the data being written, data being read, or both. Protocols can also mark a packet as stored instead of real-time which means COSMOS will not update the current value table with the packet data. Protocols can be layered and will be processed in order. For example, if you have a low-level encryption layer that must be first removed before processing a higher level buffer length protocol.",source:"@site/docs/configuration/protocols.md",sourceDirName:"configuration",slug:"/configuration/protocols",permalink:"/tools/staticdocs/docs/configuration/protocols",draft:!1,unlisted:!1,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"},sidebar:"defaultSidebar",previous:{title:"Interfaces",permalink:"/tools/staticdocs/docs/configuration/interfaces"},next:{title:"Tables",permalink:"/tools/staticdocs/docs/configuration/table"}},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:"Template Protocol",id:"template-protocol",level:3},{value:"Preidentified Protocol",id:"preidentified-protocol",level:3},{value:"Helper Protocols",id:"helper-protocols",level:2},{value:"CmdResponse Protocol",id:"cmdresponse-protocol",level:3},{value:"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",id:"initialize",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:"Examples",id:"examples",level:2}];function l(e){const t={a:"a",admonition:"admonition",code:"code",h2:"h2",h3:"h3",img:"img",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,s.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(t.p,{children:"Protocols process data on behalf of an Interface. They can modify the data being written, data being read, or both. Protocols can also mark a packet as stored instead of real-time which means COSMOS will not update the current value table with the packet data. Protocols can be layered and will be processed in order. For example, if you have a low-level encryption layer that must be first removed before processing a higher level buffer length protocol."}),"\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.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.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.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:"template-protocol",children:"Template Protocol"}),"\n",(0,r.jsx)(t.p,{children:(0,r.jsx)(t.strong,{children:"Deprecated"})}),"\n",(0,r.jsx)(t.p,{children:"This protocol is now deprecated because it is not able to capture the original SCPI messages in COSMOS raw logging. Please use the TemplateAccessor with the CmdResponseProtocol instead."}),"\n",(0,r.jsxs)(t.p,{children:["The Template Protocol works much like the Terminated Protocol except it is designed for text-based command and response type interfaces such as SCPI (Standard Commands for Programmable Instruments). It delineates packets in the same way as the Terminated Protocol except each packet is referred to as a line (because each usually contains a line of text). For outgoing packets, a CMD_TEMPLATE field is expected to exist in the packet. This field contains a template string with items to be filled in delineated within HTML tag style brackets ",(0,r.jsx)(t.code,{children:'"<EXAMPLE>"'}),". The Template Protocol will read the named items from within the packet and fill in the CMD_TEMPLATE. This filled in string is then sent out rather than the originally passed in packet. Correspondingly, if a response is expected the outgoing packet should include a RSP_TEMPLATE and RSP_PACKET field. The RSP_TEMPLATE is used to extract data from the response string and build a corresponding RSP_PACKET. See the TEMPLATE target within the COSMOS Demo configuration for an example of usage."]}),"\n",(0,r.jsxs)(t.table,{children:[(0,r.jsx)(t.thead,{children:(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.th,{children:"Parameter"}),(0,r.jsx)(t.th,{children:"Description"}),(0,r.jsx)(t.th,{children:"Required"}),(0,r.jsx)(t.th,{children:"Default"})]})}),(0,r.jsxs)(t.tbody,{children:[(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Write Termination Characters"}),(0,r.jsx)(t.td,{children:"The data to write after writing a command packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Read Termination Characters"}),(0,r.jsx)(t.td,{children:"The characters which delineate the end of a telemetry packet. Given as a hex string such as 0xABCD."}),(0,r.jsx)(t.td,{children:"Yes"}),(0,r.jsx)(t.td,{})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Ignore Lines"}),(0,r.jsx)(t.td,{children:"Number of response lines to ignore (completely drop)"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 lines"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Initial Read Delay"}),(0,r.jsx)(t.td,{children:"An initial delay after connecting after which the interface will be read till empty and data dropped. Useful for discarding connect headers and initial prompts."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no initial read)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Lines"}),(0,r.jsx)(t.td,{children:"The number of lines that make up expected responses"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"1 line"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Strip Read Termination"}),(0,r.jsx)(t.td,{children:"Whether to remove the read termination characters before returning the telemetry packet"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"true"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Discard Leading Bytes"}),(0,r.jsx)(t.td,{children:"The number of bytes to discard from the binary data after reading. Note that this applies to bytes including the sync pattern if the sync pattern is being used."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0 (do not discard bytes)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Sync Pattern"}),(0,r.jsx)(t.td,{children:"Hex string representing a byte pattern that will be searched for in the raw data. This pattern represents a packet delimiter and all data found including the sync pattern will be returned."}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"nil (no sync pattern)"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Fill Fields"}),(0,r.jsx)(t.td,{children:"Whether to fill in the sync pattern on outgoing packets"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Timeout"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait for a response before timing out"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"5.0"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Response Polling Period"}),(0,r.jsx)(t.td,{children:"Number of seconds to wait between polling for a response"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"0.02"})]}),(0,r.jsxs)(t.tr,{children:[(0,r.jsx)(t.td,{children:"Raise Exceptions"}),(0,r.jsx)(t.td,{children:"Whether to raise exceptions when errors occur like timeouts or unexpected responses"}),(0,r.jsx)(t.td,{children:"No"}),(0,r.jsx)(t.td,{children:"false"})]})]})]}),"\n",(0,r.jsx)(t.h3,{id:"preidentified-protocol",children:"Preidentified Protocol"}),"\n",(0,r.jsx)(t.p,{children:"The Preidentified Protocol delineates packets using a custom COSMOS header. This Protocol is created to allow tools to connect and receive the entire packet stream. It can also be used to chain COSMOS instances together although that should rarely be needed with the new web native implementation."}),"\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 (TODO: More documentation and examples)."}),"\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.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 found in the COSMOS gem at ",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb",children:"lib/openc3/interfaces/protocols/protocol.rb"}),". 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:"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.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.p,{children:(0,r.jsx)(t.img,{alt:"Interface Read Logic",src:n(2748).A+"",width:"1063",height:"542"})}),"\n",(0,r.jsxs)(t.p,{children:["On EVERY call to read, an empty Ruby string \"\" is first passed down to each of the read Protocol's read_data() method BEFORE new raw data is attempted to be read using the Interface's read_interface() method. This is a signal to Protocols that have cached up more than one packet worth of data to output those cached packets before any new data is read from the Interface. Typically no data will be cached up and one of the Protocols read_data() methods will return ",":STOP"," in response to the empty string, indicating that more data is required to generate a packet. Each Protocol's read_data() method can return one of three things: data that will be passed down to any additional Protocols or turned into a Packet, ",":STOP"," which means more data is required from the Interface for the Protocol to continue, or ",":DISCONNECT"," which means that something has happened that requires disconnecting the Interface (and by default trying to reconnect). Each Protocol's read_data method is passed the data that will eventually be turned into a packet and returns a possibly modified set of data. If the data passes through all Protocol's 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 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(8129).A+"",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.jsxs)(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.jsx)(t.h3,{id:"initialize",children:"initialize"}),"\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 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:"As you can see, every Protocol maintains state on at least two items. @interface holds the Interface class instance that the protocol is associated with. This is sometimes necessary to introspect details that only the Interface knows. @allow_empty_data is a flag used by the read_data(data) method that is discussed later in this document."}),"\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 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:"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 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:"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 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:"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.jsxs)(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 Ruby string of data, ",":STOP",", or ",":DISCONNECT",". If it returns a Ruby string, then it believes that data may be ready to be a full packet, and is ready for processing by any following Protocols. If ",":STOP"," is returned then the Protocol believes it needs more data to complete a full packet. If ",":DISCONNECT"," is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."]}),"\n",(0,r.jsx)(t.p,{children:"Base Class Implemenation:"}),"\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.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 or if it nil and the Protocol is the last in the chain, then the base implementation will return ",":STOP"," data to indicate that it is time to call the Interface read_interface() method to get more data. Blank strings are used to signal Protocols that they have an opportunity to return a cached packet."]}),"\n",(0,r.jsx)(t.h3,{id:"read_packet",children:"read_packet"}),"\n",(0,r.jsxs)(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 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:"The base class always just returns the packet given."}),"\n",(0,r.jsx)(t.h3,{id:"write_packet",children:"write_packet"}),"\n",(0,r.jsxs)(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 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:"The base class always just returns the packet given."}),"\n",(0,r.jsx)(t.h3,{id:"write_data",children:"write_data"}),"\n",(0,r.jsxs)(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 Ruby String of data, ",":STOP",", or ",":DISCONNECT",". If it returns a Ruby string of data, then it believes that the data is valid, should be written out the Interface, and is ready for processing by any following Protocols. If ",":STOP"," is returned then the Protocol believes the data should be silently dropped. If ",":DISCONNECT"," is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected)."]}),"\n",(0,r.jsx)(t.p,{children:"Base Class 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:"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 write_packet() and the data that was actually written out the Interface. It can return either the same pair of packet/data, ",":STOP",", or ",":DISCONNECT",". If it returns a packet/data pair then they are passed on to any other Protocols. If ",":STOP"," is returned then the Interface write() call completes and no further Protocols post_write_interface() methods are called. If ",":DISCONNECT",' is returned then the Protocol believes the Interface should be disconnected (and typically automatically reconnected). Note that only the first parameter "packet", is checked to be ',":STOP",", or ",":DISCONNECT"," on the return."]}),"\n",(0,r.jsx)(t.p,{children:"Base Class 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:"The base class always just returns the packet/data given."}),"\n",(0,r.jsx)(t.h2,{id:"examples",children:"Examples"}),"\n",(0,r.jsx)(t.p,{children:"Please see the included COSMOS protocol code for examples of the above methods in action."}),"\n",(0,r.jsxs)(t.p,{children:[(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/protocol.rb",children:"lib/openc3/interfaces/protocols/protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/burst_protocol.rb",children:"lib/openc3/interfaces/protocols/burst_protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/fixed_protocol.rb",children:"lib/openc3/interfaces/protocols/fixed_protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/length_protocol.rb",children:"lib/openc3/interfaces/protocols/length_protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/terminated_protocol.rb",children:"lib/openc3/interfaces/protocols/terminated_protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/template_protocol.rb",children:"lib/openc3/interfaces/protocols/template_protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/crc_protocol.rb",children:"lib/openc3/interfaces/protocols/crc_protocol.rb"}),"\n",(0,r.jsx)(t.a,{href:"https://github.com/OpenC3/cosmos/blob/main/openc3/lib/openc3/interfaces/protocols/preidentified_protocol.rb",children:"lib/openc3/interfaces/protocols/preidentified_protocol.rb"})]})]})}function h(e={}){const{wrapper:t}={...(0,s.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(l,{...e})}):l(e)}},2748:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/interface_read_logic-0deef27c1d2fec9de2a3720a3c9ecedb21a00dca7aabd13da0b8815c037e4c26.png"},8129:(e,t,n)=>{n.d(t,{A:()=>r});const r=n.p+"assets/images/interface_write_logic-3360afe1b4af20b10dafba848a21e09baccaacc06e2ec8b6c132ac7a3c99e994.png"},1184:(e,t,n)=>{n.d(t,{R:()=>i});var r=n(4041);const s={},a=r.createContext(s);function i(e){const t=r.useContext(a);return r.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}}}]);
@@ -0,0 +1 @@
1
+ "use strict";(self.webpackChunkdocs_openc3_com=self.webpackChunkdocs_openc3_com||[]).push([[3724],{2938:(e,t,i)=>{i.r(t),i.d(t,{assets:()=>a,contentTitle:()=>l,default:()=>o,frontMatter:()=>n,metadata:()=>d,toc:()=>h});var s=i(1085),r=i(1184);const n={sidebar_position:5,title:"Telemetry"},l=void 0,d={id:"configuration/telemetry",title:"Telemetry",description:"Telemetry Definition Files",source:"@site/docs/configuration/telemetry.md",sourceDirName:"configuration",slug:"/configuration/telemetry",permalink:"/tools/staticdocs/docs/configuration/telemetry",draft:!1,unlisted:!1,editUrl:"https://github.com/OpenC3/cosmos/tree/main/docs.openc3.com/docs/configuration/telemetry.md",tags:[],version:"current",sidebarPosition:5,frontMatter:{sidebar_position:5,title:"Telemetry"},sidebar:"defaultSidebar",previous:{title:"Commands",permalink:"/tools/staticdocs/docs/configuration/command"},next:{title:"Interfaces",permalink:"/tools/staticdocs/docs/configuration/interfaces"}},a={},h=[{value:"Telemetry Definition Files",id:"telemetry-definition-files",level:2},{value:"ID Items",id:"id-items",level:3},{value:"Variable Sized Items",id:"variable-sized-items",level:3},{value:"Derived Items",id:"derived-items",level:3},{value:"Received Time and Packet Time",id:"received-time-and-packet-time",level:3},{value:"Example",id:"example",level:4},{value:"TELEMETRY",id:"telemetry",level:2},{value:"TELEMETRY Modifiers",id:"telemetry-modifiers",level:2},{value:"ITEM",id:"item",level:3},{value:"ITEM Modifiers",id:"item-modifiers",level:3},{value:"FORMAT_STRING",id:"format_string",level:4},{value:"UNITS",id:"units",level:4},{value:"DESCRIPTION",id:"description",level:4},{value:"META",id:"meta",level:4},{value:"OVERLAP",id:"overlap",level:4},{value:"KEY",id:"key",level:4},{value:"STATE",id:"state",level:4},{value:"READ_CONVERSION",id:"read_conversion",level:4},{value:"POLY_READ_CONVERSION",id:"poly_read_conversion",level:4},{value:"SEG_POLY_READ_CONVERSION",id:"seg_poly_read_conversion",level:4},{value:"GENERIC_READ_CONVERSION_START",id:"generic_read_conversion_start",level:4},{value:"GENERIC_READ_CONVERSION_END",id:"generic_read_conversion_end",level:4},{value:"LIMITS",id:"limits",level:4},{value:"LIMITS_RESPONSE",id:"limits_response",level:4},{value:"APPEND_ITEM",id:"append_item",level:3},{value:"ID_ITEM",id:"id_item",level:3},{value:"APPEND_ID_ITEM",id:"append_id_item",level:3},{value:"ARRAY_ITEM",id:"array_item",level:3},{value:"APPEND_ARRAY_ITEM",id:"append_array_item",level:3},{value:"SELECT_ITEM",id:"select_item",level:3},{value:"DELETE_ITEM",id:"delete_item",level:3},{value:"META",id:"meta-1",level:3},{value:"PROCESSOR",id:"processor",level:3},{value:"ALLOW_SHORT",id:"allow_short",level:3},{value:"HIDDEN",id:"hidden",level:3},{value:"ACCESSOR",id:"accessor",level:3},{value:"IGNORE_OVERLAP",id:"ignore_overlap",level:3},{value:"SELECT_TELEMETRY",id:"select_telemetry",level:2},{value:"LIMITS_GROUP",id:"limits_group",level:2},{value:"LIMITS_GROUP_ITEM",id:"limits_group_item",level:2},{value:"Example File",id:"example-file",level:2}];function c(e){const t={a:"a",admonition:"admonition",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,r.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(t.h2,{id:"telemetry-definition-files",children:"Telemetry Definition Files"}),"\n",(0,s.jsxs)(t.p,{children:["Telemetry definition files define the telemetry packets that can be received and processed from COSMOS targets. One large file can be used to define the telemetry packets, or multiple files can be used at the user's discretion. Telemetry definition files are placed in the target's cmd_tlm directory and are processed alphabetically. Therefore if you have some telemetry files that depend on others, e.g. they override or extend existing telemetry, they must be named last. The easist way to do this is to add an extension to an existing file name. For example, if you already have tlm.txt you can create tlm_override.txt for telemetry that depends on the definitions in tlm.txt. Note that due to the way the ",(0,s.jsx)(t.a,{href:"http://www.asciitable.com/",children:"ASCII Table"})," is structured, files beginning with capital letters are processed before lower case letters."]}),"\n",(0,s.jsx)(t.p,{children:"When defining telemetry items you can choose from the following data types: INT, UINT, FLOAT, STRING, BLOCK. These correspond to integers, unsigned integers, floating point numbers, strings and binary blocks of data. Within COSMOS, the only difference between a STRING and BLOCK is when COSMOS reads a STRING type it stops reading when it encounters a null byte (0). This shows up when displaying the value in Packet Viewer or Tlm Viewer and in the output of Data Extractor. You should strive to store non-ASCII data inside BLOCK items and ASCII strings in STRING items."}),"\n",(0,s.jsx)(t.admonition,{title:"Printing Data",type:"info",children:(0,s.jsxs)(t.p,{children:["Most data types can be printed in a COSMOS script simply by doing ",(0,s.jsx)("code",{children:'puts tlm("TGT PKT ITEM")'}),". However, if the ITEM is a BLOCK data type and contains binary (non-ASCII) data then that won't work. COSMOS comes with a built-in method called ",(0,s.jsx)("code",{children:"formatted"})," to help you view binary data. If ITEM is a BLOCK type containing binary try ",(0,s.jsx)("code",{children:'puts tlm("TGT PKT ITEM").formatted'})," which will print the bytes out as hex."]})}),"\n",(0,s.jsx)(t.h3,{id:"id-items",children:"ID Items"}),"\n",(0,s.jsxs)(t.p,{children:["All packets require identification items so the incoming data can be matched to a packet structure. These items are defined using the ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/telemetry#id_item",children:"ID_ITEM"})," and ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/telemetry#append_id_item",children:"APPEND_ID_ITEM"}),". As data is read from the interface and refined by the protocol, the resulting packet is identified by matching all the ID fields. Note that ideally all packets in a particular target should use the exact same bit offset, bit size, and data type to identify. If this is not the case, you must set ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/target#tlm_unique_id_mode",children:"TLM_UNIQUE_ID_MODE"})," in the target.txt file which incurs a performance penalty on every packet identification."]}),"\n",(0,s.jsx)(t.h3,{id:"variable-sized-items",children:"Variable Sized Items"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS specifies a variable sized item with a bit size of 0. When a packet is identified, all other data that isn't explicitly defined will be put into the variable sized item. These items are typically used for packets containing memory dumps which vary in size depending on the number of bytes dumped. Note that there can only be one variable sized item per packet."}),"\n",(0,s.jsx)(t.h3,{id:"derived-items",children:"Derived Items"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS has a concept of a derived item which is a telemetry item that doesn't actually exist in the binary data. Derived items are typically computed based on other telemetry items. COSMOS derived items are very similar to real items except they use the special DERIVED data type. Here is how a derived item might look in a telemetry definition."}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'ITEM TEMP_AVERAGE 0 0 DERIVED "Average of TEMP1, TEMP2, TEMP3, TEMP4"\n'})}),"\n",(0,s.jsxs)(t.p,{children:["Note the bit offset and bit size of 0 and the data type of DERIVED. For this reason DERIVED items should be declared using ITEM rather than APPEND_ITEM. They can be defined anywhere in the packet definition but are typically placed at the end. The ITEM definition must be followed by a CONVERSION keyword, e.g. ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/configuration/telemetry#read_conversion",children:"READ_CONVERSION"}),", to generate the value."]}),"\n",(0,s.jsx)(t.h3,{id:"received-time-and-packet-time",children:"Received Time and Packet Time"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS automatically creates several telemetry items on every packet: PACKET_TIMESECONDS, PACKET_TIMEFORMATTED, RECEIVED_COUNT, RECEIVED_TIMEFORMATTED, and RECEIVED_TIMESECONDS."}),"\n",(0,s.jsx)(t.p,{children:"RECEIVED_TIME is the time that COSMOS receives the packet. This is set by the interface which is connected to the target and is receiving the raw data. Once a packet has been created out of the raw data the time is set."}),"\n",(0,s.jsx)(t.p,{children:"PACKET_TIME defaults to RECEIVED_TIME, but can be set as a derived item with a time object in the telemetry configuration file. This helps support stored telemetry packets so that they can be more reasonably handled by other COSMOS tools such as Telemetry Grapher and Data Extractor. You can set the 'stored' flag in your interface and the current value table is unaffected."}),"\n",(0,s.jsxs)(t.p,{children:["The _TIMEFORMATTED items returns the date and time in a YYYY/MM/DD HH:MM",":SS",".sss format and the _TIMESECONDS returns the Unix seconds of the time."]}),"\n",(0,s.jsx)(t.h4,{id:"example",children:"Example"}),"\n",(0,s.jsx)(t.p,{children:"COSMOS provides a Unix time conversion class which returns a Ruby time object based on the number of seconds and (optionally) microseconds since the Unix epoch. Note: This returns a Ruby Time object and not a float or string!"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{children:'ITEM PACKET_TIME 0 0 DERIVED "Ruby time based on TIMESEC and TIMEUS"\n READ_CONVERSION unix_time_conversion.rb TIMESEC TIMEUS\n'})}),"\n",(0,s.jsx)(t.p,{children:"Definining PACKET_TIME allows the PACKET_TIMESECONDS and PACKET_TIMEFORMATTED to be calculated against an internal Packet time rather than the time COSMOS receives the packet."}),"\n",(0,s.jsx)("div",{style:{clear:"both"}}),"\n",(0,s.jsx)(t.h1,{id:"telemetry-keywords",children:"Telemetry Keywords"}),"\n",(0,s.jsx)(t.h2,{id:"telemetry",children:"TELEMETRY"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a new telemetry packet"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Target"}),(0,s.jsx)(t.td,{children:"Name of the target this telemetry packet is associated with"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Command"}),(0,s.jsx)(t.td,{children:"Name of this telemetry packet. Also referred to as its mnemonic. Must be unique to telemetry packets in this target. Ideally will be as short and clear as possible."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the data in this packet is in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description of this telemetry packet which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'TELEMETRY INST HEALTH_STATUS BIG_ENDIAN "Instrument health and status"\n'})}),"\n",(0,s.jsx)(t.h2,{id:"telemetry-modifiers",children:"TELEMETRY Modifiers"}),"\n",(0,s.jsx)(t.p,{children:"The following keywords must follow a TELEMETRY keyword."}),"\n",(0,s.jsx)(t.h3,{id:"item",children:"ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a telemetry item in the current telemetry packet"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"Name of the telemety item. Must be unique within the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Offset"}),(0,s.jsx)(t.td,{children:"Bit offset into the telemetry packet of the Most Significant Bit of this item. May be negative to indicate on offset from the end of the packet. Always use a bit offset of 0 for derived item."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of this telemetry item. Zero or Negative values may be used to indicate that a string fills the packet up to the offset from the end of the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then this is a derived parameter and the Data Type must be set to 'DERIVED'."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Data Type"}),(0,s.jsxs)(t.td,{children:["Data Type of this telemetry item",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK, DERIVED"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description for this telemetry item which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the item is to be interpreted in Big Endian or Little Endian format. See guide on ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/guides/little-endian-bitfields",children:"Little Endian Bitfields"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'ITEM PKTID 112 16 UINT "Packet ID"\nITEM DATA 0 0 DERIVED "Derived data"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"item-modifiers",children:"ITEM Modifiers"}),"\n",(0,s.jsx)(t.p,{children:"The following keywords must follow a ITEM keyword."}),"\n",(0,s.jsx)(t.h4,{id:"format_string",children:"FORMAT_STRING"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Adds printf style formatting"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Format"}),(0,s.jsx)(t.td,{children:"How to format using printf syntax. For example, '0x%0X' will display the value in hex."}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'FORMAT_STRING "0x%0X"\n'})}),"\n",(0,s.jsx)(t.h4,{id:"units",children:"UNITS"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Add displayed units"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Full Name"}),(0,s.jsx)(t.td,{children:"Full name of the units type, e.g. Celsius"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Abbreviated"}),(0,s.jsx)(t.td,{children:"Abbreviation for the units, e.g. C"}),(0,s.jsx)(t.td,{children:"True"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"UNITS Celsius C\nUNITS Kilometers KM\n"})}),"\n",(0,s.jsx)(t.h4,{id:"description",children:"DESCRIPTION"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Override the defined description"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Value"}),(0,s.jsx)(t.td,{children:"The new description"}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.h4,{id:"meta",children:"META"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Stores custom user metadata"})}),"\n",(0,s.jsx)(t.p,{children:"Meta data is user specific data that can be used by custom tools for various purposes. One example is to store additional information needed to generate source code header files."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Meta Name"}),(0,s.jsx)(t.td,{children:"Name of the metadata to store"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Meta Values"}),(0,s.jsx)(t.td,{children:"One or more values to be stored for this Meta Name"}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'META TEST "This parameter is for test purposes only"\n'})}),"\n",(0,s.jsx)(t.h4,{id:"overlap",children:"OVERLAP"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 4.4.1)"}),(0,s.jsx)(t.strong,{children:"This item is allowed to overlap other items in the packet"})]}),"\n",(0,s.jsx)(t.p,{children:"If an item's bit offset overlaps another item, OpenC3 issues a warning. This keyword explicitly allows an item to overlap another and supresses the warning message."}),"\n",(0,s.jsx)(t.h4,{id:"key",children:"KEY"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 5.0.10)"}),(0,s.jsx)(t.strong,{children:"Defines the key used to access this raw value in the packet."})]}),"\n",(0,s.jsx)(t.p,{children:"Keys are often JsonPath or XPath strings"}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Key string"}),(0,s.jsx)(t.td,{children:"The key to access this item"}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"KEY $.book.title\n"})}),"\n",(0,s.jsx)(t.h4,{id:"state",children:"STATE"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a key/value pair for the current item"})}),"\n",(0,s.jsx)(t.p,{children:"Key value pairs allow for user friendly strings. For example, you might define states for ON = 1 and OFF = 0. This allows the word ON to be used rather than the number 1 when sending the telemetry item and allows for much greater clarity and less chance for user error. A catch all value of ANY applies to all other values not already defined as state values."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Key"}),(0,s.jsx)(t.td,{children:"The string state name"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Value"}),(0,s.jsx)(t.td,{children:"The numerical state value or ANY to apply the state to all other values"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Color"}),(0,s.jsxs)(t.td,{children:["The color the state should be displayed as",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"GREEN, YELLOW, RED"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'APPEND_ITEM ENABLE 32 UINT "Enable setting"\n STATE FALSE 0\n STATE TRUE 1\n STATE ERROR ANY # Match all other values to ERROR\nAPPEND_ITEM STRING 1024 STRING "String"\n STATE "NOOP" "NOOP" GREEN\n STATE "ARM LASER" "ARM LASER" YELLOW\n STATE "FIRE LASER" "FIRE LASER" RED\n'})}),"\n",(0,s.jsx)(t.h4,{id:"read_conversion",children:"READ_CONVERSION"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Applies a conversion to the current telemetry item"})}),"\n",(0,s.jsx)(t.p,{children:"Conversions are implemented in a custom Ruby file which should be located in the target's lib folder. The class must require 'openc3/conversions/conversion' and inherit from Conversion. It must implement the initialize method if it takes extra parameters and must always implement the call method. The conversion factor is applied to the raw value in the telemetry packet before it is displayed to the user. The user still has the ability to see the raw unconverted value in a details dialog."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Class Filename"}),(0,s.jsx)(t.td,{children:"The filename which contains the Ruby class. The filename must be named after the class such that the class is a CamelCase version of the underscored filename. For example, 'the_great_conversion.rb' should contain 'class TheGreatConversion'."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Parameter"}),(0,s.jsx)(t.td,{children:"Additional parameter values for the conversion which are passed to the class constructor."}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"READ_CONVERSION the_great_conversion.rb 1000\n\nDefined in the_great_conversion.rb:\n\nrequire 'openc3/conversions/conversion'\nmodule OpenC3\n class TheGreatConversion < Conversion\n def initialize(multiplier)\n super()\n @multiplier = multiplier.to_f\n end\n def call(value, packet, buffer)\n return value * @multiplier\n end\n end\nend\n"})}),"\n",(0,s.jsx)(t.h4,{id:"poly_read_conversion",children:"POLY_READ_CONVERSION"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Adds a polynomial conversion factor to the current telemetry item"})}),"\n",(0,s.jsx)(t.p,{children:"The conversion factor is applied to raw value in the telemetry packet before it is displayed to the user. The user still has the ability to see the raw unconverted value in a details dialog."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"C0"}),(0,s.jsx)(t.td,{children:"Coefficient"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Cx"}),(0,s.jsx)(t.td,{children:"Additional coefficient values for the conversion. Any order polynomial conversion may be used so the value of 'x' will vary with the order of the polynomial. Note that larger order polynomials take longer to process than shorter order polynomials, but are sometimes more accurate."}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"POLY_READ_CONVERSION 10 0.5 0.25\n"})}),"\n",(0,s.jsx)(t.h4,{id:"seg_poly_read_conversion",children:"SEG_POLY_READ_CONVERSION"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Adds a segmented polynomial conversion factor to the current telemetry item"})}),"\n",(0,s.jsx)(t.p,{children:"This conversion factor is applied to the raw value in the telemetry packet before it is displayed to the user. The user still has the ability to see the raw unconverted value in a details dialog."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Lower Bound"}),(0,s.jsx)(t.td,{children:"Defines the lower bound of the range of values that this segmented polynomial applies to. Is ignored for the segment with the smallest lower bound."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"C0"}),(0,s.jsx)(t.td,{children:"Coefficient"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Cx"}),(0,s.jsx)(t.td,{children:"Additional coefficient values for the conversion. Any order polynomial conversion may be used so the value of 'x' will vary with the order of the polynomial. Note that larger order polynomials take longer to process than shorter order polynomials, but are sometimes more accurate."}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"SEG_POLY_READ_CONVERSION 0 10 0.5 0.25 # Apply the conversion to all values < 50\nSEG_POLY_READ_CONVERSION 50 11 0.5 0.275 # Apply the conversion to all values >= 50 and < 100\nSEG_POLY_READ_CONVERSION 100 12 0.5 0.3 # Apply the conversion to all values >= 100\n"})}),"\n",(0,s.jsx)(t.h4,{id:"generic_read_conversion_start",children:"GENERIC_READ_CONVERSION_START"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Start a generic read conversion"})}),"\n",(0,s.jsx)(t.p,{children:"Adds a generic conversion function to the current telemetry item. This conversion factor is applied to the raw value in the telemetry packet before it is displayed to the user. The user still has the ability to see the raw unconverted value in a details dialog. The conversion is specified as ruby code that receives two implied parameters. 'value' which is the raw value being read and 'packet' which is a reference to the telemetry packet class (Note, referencing the packet as 'myself' is still supported for backwards compatibility). The last line of ruby code given should return the converted value. The GENERIC_READ_CONVERSION_END keyword specifies that all lines of ruby code for the conversion have been given."}),"\n",(0,s.jsx)(t.admonition,{type:"warning",children:(0,s.jsx)(t.p,{children:"Generic conversions are not a good long term solution. Consider creating a conversion class and using READ_CONVERSION instead. READ_CONVERSION is easier to debug and higher performance."})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Converted Type"}),(0,s.jsxs)(t.td,{children:["Type of the converted value",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK"})]}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Converted Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of converted value"}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"APPEND_ITEM ITEM1 32 UINT\n GENERIC_READ_CONVERSION_START\n value * 1.5 # Convert the value by a scale factor\n GENERIC_READ_CONVERSION_END\n"})}),"\n",(0,s.jsx)(t.h4,{id:"generic_read_conversion_end",children:"GENERIC_READ_CONVERSION_END"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Complete a generic read conversion"})}),"\n",(0,s.jsx)(t.h4,{id:"limits",children:"LIMITS"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a set of limits for a telemetry item"})}),"\n",(0,s.jsx)(t.p,{children:'If limits are violated a message is printed in the Command and Telemetry Server to indicate an item went out of limits. Other tools also use this information to update displays with different colored telemetry items or other useful information. The concept of "limits sets" is defined to allow for different limits values in different environments. For example, you might want tighter or looser limits on telemetry if your environment changes such as during thermal vacuum testing.'}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Limits Set"}),(0,s.jsx)(t.td,{children:"Name of the limits set. If you have no unique limits sets use the keyword DEFAULT."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Persistence"}),(0,s.jsx)(t.td,{children:"Number of consecutive times the telemetry item must be within a different limits range before changing limits state."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Initial State"}),(0,s.jsxs)(t.td,{children:["Whether limits monitoring for this telemetry item is initially enabled or disabled. Note if you have multiple LIMITS items they should all have the same initial state.",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"ENABLED, DISABLED"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Red Low Limit"}),(0,s.jsx)(t.td,{children:"If the telemetry value is less than or equal to this value a Red Low condition will be detected"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Yellow Low Limit"}),(0,s.jsx)(t.td,{children:"If the telemetry value is less than or equal to this value, but greater than the Red Low Limit, a Yellow Low condition will be detected"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Yellow High Limit"}),(0,s.jsx)(t.td,{children:"If the telemetry value is greater than or equal to this value, but less than the Red High Limit, a Yellow High condition will be detected"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Red High Limit"}),(0,s.jsx)(t.td,{children:"If the telemetry value is greater than or equal to this value a Red High condition will be detected"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Green Low Limit"}),(0,s.jsx)(t.td,{children:'Setting the Green Low and Green High limits defines an "operational limit" which is colored blue by OpenC3. This allows for a distinct desired operational range which is narrower than the green safety limit. If the telemetry value is greater than or equal to this value, but less than the Green High Limit, a Blue operational condition will be detected.'}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Green High Limit"}),(0,s.jsx)(t.td,{children:'Setting the Green Low and Green High limits defines an "operational limit" which is colored blue by OpenC3. This allows for a distinct desired operational range which is narrower than the green safety limit. If the telemetry value is less than or equal to this value, but greater than the Green Low Limit, a Blue operational condition will be detected.'}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"LIMITS DEFAULT 3 ENABLED -80.0 -70.0 60.0 80.0 -20.0 20.0\nLIMITS TVAC 3 ENABLED -80.0 -30.0 30.0 80.0\n"})}),"\n",(0,s.jsx)(t.h4,{id:"limits_response",children:"LIMITS_RESPONSE"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a response class that is called when the limits state of the current item changes"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Class Filename"}),(0,s.jsx)(t.td,{children:"Name of the Ruby file which implements the limits response. This file should be in the config/TARGET/lib directory so it can be found by OpenC3."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Response Specific Options"}),(0,s.jsx)(t.td,{children:"Variable length number of options that will be passed to the class constructor"}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"LIMITS_RESPONSE example_limits_response.rb 10\n"})}),"\n",(0,s.jsx)(t.h3,{id:"append_item",children:"APPEND_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a telemetry item in the current telemetry packet"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"Name of the telemety item. Must be unique within the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of this telemetry item. Zero or Negative values may be used to indicate that a string fills the packet up to the offset from the end of the packet specified by this value. If Bit Offset is 0 and Bit Size is 0 then this is a derived parameter and the Data Type must be set to 'DERIVED'."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Data Type"}),(0,s.jsxs)(t.td,{children:["Data Type of this telemetry item",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK, DERIVED"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description for this telemetry item which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the item is to be interpreted in Big Endian or Little Endian format. See guide on ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/guides/little-endian-bitfields",children:"Little Endian Bitfields"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'APPEND_ITEM PKTID 16 UINT "Packet ID"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"id_item",children:"ID_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:'Defines a telemetry item in the current telemetry packet. Note, packets defined without one or more ID_ITEMs are "catch-all" packets which will match all incoming data. Normally this is the job of the UNKNOWN packet.'})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"Name of the telemety item. Must be unique within the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Offset"}),(0,s.jsx)(t.td,{children:"Bit offset into the telemetry packet of the Most Significant Bit of this item. May be negative to indicate on offset from the end of the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of this telemetry item. Zero or Negative values may be used to indicate that a string fills the packet up to the offset from the end of the packet specified by this value."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Data Type"}),(0,s.jsxs)(t.td,{children:["Data Type of this telemetry item",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ID Value"}),(0,s.jsx)(t.td,{children:"The value of this telemetry item that uniquely identifies this telemetry packet"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description for this telemetry item which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the item is to be interpreted in Big Endian or Little Endian format. See guide on ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/guides/little-endian-bitfields",children:"Little Endian Bitfields"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'ID_ITEM PKTID 112 16 UINT 1 "Packet ID which must be 1"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"append_id_item",children:"APPEND_ID_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a telemetry item in the current telemetry packet"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"Name of the telemety item. Must be unique within the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of this telemetry item. Zero or Negative values may be used to indicate that a string fills the packet up to the offset from the end of the packet specified by this value."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Data Type"}),(0,s.jsxs)(t.td,{children:["Data Type of this telemetry item",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"ID Value"}),(0,s.jsx)(t.td,{children:"The value of this telemetry item that uniquely identifies this telemetry packet"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description for this telemetry item which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the item is to be interpreted in Big Endian or Little Endian format. See guide on ",(0,s.jsx)(t.a,{href:"/tools/staticdocs/docs/guides/little-endian-bitfields",children:"Little Endian Bitfields"}),".",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'APPEND_ID_ITEM PKTID 16 UINT 1 "Packet ID which must be 1"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"array_item",children:"ARRAY_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a telemetry item in the current telemetry packet that is an array"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"Name of the telemety item. Must be unique within the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Bit Offset"}),(0,s.jsx)(t.td,{children:"Bit offset into the telemetry packet of the Most Significant Bit of this item. May be negative to indicate on offset from the end of the packet. Always use a bit offset of 0 for derived item."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of each array item"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item Data Type"}),(0,s.jsxs)(t.td,{children:["Data Type of each array item",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK, DERIVED"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Array Bit Size"}),(0,s.jsx)(t.td,{children:"Total Bit Size of the Array. Zero or Negative values may be used to indicate the array fills the packet up to the offset from the end of the packet specified by this value."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the data is to be sent in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'ARRAY_ITEM ARRAY 64 32 FLOAT 320 "Array of 10 floats"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"append_array_item",children:"APPEND_ARRAY_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a telemetry item in the current telemetry packet that is an array"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Name"}),(0,s.jsx)(t.td,{children:"Name of the telemety item. Must be unique within the packet."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item Bit Size"}),(0,s.jsx)(t.td,{children:"Bit size of each array item"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item Data Type"}),(0,s.jsxs)(t.td,{children:["Data Type of each array item",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"INT, UINT, FLOAT, STRING, BLOCK, DERIVED"})]}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Array Bit Size"}),(0,s.jsx)(t.td,{children:"Total Bit Size of the Array. Zero or Negative values may be used to indicate the array fills the packet up to the offset from the end of the packet specified by this value."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Description"}),(0,s.jsx)(t.td,{children:"Description which must be enclosed with quotes"}),(0,s.jsx)(t.td,{children:"False"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Endianness"}),(0,s.jsxs)(t.td,{children:["Indicates if the data is to be sent in Big Endian or Little Endian format",(0,s.jsx)("br",{}),(0,s.jsx)("br",{}),"Valid Values: ",(0,s.jsx)("span",{class:"values",children:"BIG_ENDIAN, LITTLE_ENDIAN"})]}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'APPEND_ARRAY_ITEM ARRAY 32 FLOAT 320 "Array of 10 floats"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"select_item",children:"SELECT_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Selects an existing telemetry item for editing"})}),"\n",(0,s.jsx)(t.p,{children:"Must be used in conjunction with SELECT_TELEMETRY to first select the packet. Typically used to override generated values or make specific changes to telemetry that only affect a particular instance of a target used multiple times."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item"}),(0,s.jsx)(t.td,{children:"Name of the item to select for modification"}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"SELECT_TELEMETRY INST HEALTH_STATUS\n SELECT_ITEM TEMP1\n # Define limits for this item, overrides or replaces any existing\n LIMITS DEFAULT 3 ENABLED -90.0 -80.0 80.0 90.0 -20.0 20.0\n"})}),"\n",(0,s.jsx)(t.h3,{id:"delete_item",children:"DELETE_ITEM"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 4.4.1)"}),(0,s.jsx)(t.strong,{children:"Delete an existing telemetry item from the packet definition"})]}),"\n",(0,s.jsx)(t.p,{children:'Deleting an item from the packet definition does not remove the defined space for that item. Thus unless you redefine a new item, there will be a "hole" in the packet where the data is not accessible. You can use SELECT_TELEMETRY and then ITEM to define a new item.'}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item"}),(0,s.jsx)(t.td,{children:"Name of the item to delete"}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"SELECT_TELEMETRY INST HEALTH_STATUS\n DELETE_ITEM TEMP4\n"})}),"\n",(0,s.jsx)(t.h3,{id:"meta-1",children:"META"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Stores metadata for the current telemetry packet"})}),"\n",(0,s.jsx)(t.p,{children:"Meta data is user specific data that can be used by custom tools for various purposes. One example is to store additional information needed to generate source code header files."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Meta Name"}),(0,s.jsx)(t.td,{children:"Name of the metadata to store"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Meta Values"}),(0,s.jsx)(t.td,{children:"One or more values to be stored for this Meta Name"}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'META FSW_TYPE "struct tlm_packet"\n'})}),"\n",(0,s.jsx)(t.h3,{id:"processor",children:"PROCESSOR"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a processor class that executes code every time a packet is received"})}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Processor Name"}),(0,s.jsx)(t.td,{children:"The name of the processor"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Processor Class Filename"}),(0,s.jsx)(t.td,{children:"Name of the Ruby file which implements the processor. This file should be in the config/TARGET/lib directory so it can be found by OpenC3."}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Processor Specific Options"}),(0,s.jsx)(t.td,{children:"Variable length number of options that will be passed to the class constructor."}),(0,s.jsx)(t.td,{children:"False"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"PROCESSOR TEMP1HIGH watermark_processor.rb TEMP1\n"})}),"\n",(0,s.jsx)(t.h3,{id:"allow_short",children:"ALLOW_SHORT"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Process telemetry packets which are less than their defined length"})}),"\n",(0,s.jsx)(t.p,{children:"Allows the telemetry packet to be received with a data portion that is smaller than the defined size without warnings. Any extra space in the packet will be filled in with zeros by OpenC3."}),"\n",(0,s.jsx)(t.h3,{id:"hidden",children:"HIDDEN"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Hides this telemetry packet from all the OpenC3 tools"})}),"\n",(0,s.jsx)(t.p,{children:"This packet will not appear in Packet Viewer, Telemetry Grapher and Handbook Creator. It also hides this telemetry from appearing in the Script Runner popup helper when writing scripts. The telemetry still exists in the system and can received and checked by scripts."}),"\n",(0,s.jsx)(t.h3,{id:"accessor",children:"ACCESSOR"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 5.0.10)"}),(0,s.jsx)(t.strong,{children:"Defines the class used to read and write raw values from the packet"})]}),"\n",(0,s.jsx)(t.p,{children:"Defines the class that is used too read raw values from the packet. Defaults to BinaryAccessor. Provided accessors also include JsonAccessor, CborAccessor, HtmlAccessor, and XmlAccessor."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Accessor Class Name"}),(0,s.jsx)(t.td,{children:"The name of the accessor class"}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.h3,{id:"ignore_overlap",children:"IGNORE_OVERLAP"}),"\n",(0,s.jsxs)(t.p,{children:[(0,s.jsx)("div",{class:"right",children:"(Since 5.15.3)"}),(0,s.jsx)(t.strong,{children:"Ignores any packet items which overlap"})]}),"\n",(0,s.jsx)(t.p,{children:"Packet items which overlap normally generate a warning unless each individual item has the OVERLAP keyword. This ignores overlaps across the entire packet."}),"\n",(0,s.jsx)(t.h2,{id:"select_telemetry",children:"SELECT_TELEMETRY"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Selects an existing telemetry packet for editing"})}),"\n",(0,s.jsx)(t.p,{children:"Typically used in a separate configuration file from where the original telemetry is defined to override or add to the existing telemetry definition. Must be used in conjunction with SELECT_ITEM to change an individual item."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Target Name"}),(0,s.jsx)(t.td,{children:"Name of the target this telemetry packet is associated with"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Packet Name"}),(0,s.jsx)(t.td,{children:"Name of the telemetry packet to select"}),(0,s.jsx)(t.td,{children:"True"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"SELECT_TELEMETRY INST HEALTH_STATUS\n SELECT_ITEM TEMP1\n # Define limits for this item, overrides or replaces any existing\n LIMITS DEFAULT 3 ENABLED -90.0 -80.0 80.0 90.0 -20.0 20.0\n"})}),"\n",(0,s.jsx)(t.h2,{id:"limits_group",children:"LIMITS_GROUP"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Defines a group of related limits Items"})}),"\n",(0,s.jsx)(t.p,{children:'Limits groups contain telemetry items that can be enabled and disabled together. It can be used to group related limits as a subsystem that can be enabled or disabled as that particular subsystem is powered (for example). To enable a group call the enable_limits_group("NAME") method in Script Runner. To disable a group call the disable_limits_group("NAME") in Script Runner. Items can belong to multiple groups but the last enabled or disabled group "wins". For example, if an item belongs to GROUP1 and GROUP2 and you first enable GROUP1 and then disable GROUP2 the item will be disabled. If you then enable GROUP1 again it will be enabled.'}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsx)(t.tbody,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Group Name"}),(0,s.jsx)(t.td,{children:"Name of the limits group"}),(0,s.jsx)(t.td,{children:"True"})]})})]}),"\n",(0,s.jsx)(t.h2,{id:"limits_group_item",children:"LIMITS_GROUP_ITEM"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Adds the specified telemetry item to the last defined LIMITS_GROUP"})}),"\n",(0,s.jsx)(t.p,{children:"Limits group information is typically kept in a separate configuration file in the config/TARGET/cmd_tlm folder named limits_groups.txt."}),"\n",(0,s.jsxs)(t.table,{children:[(0,s.jsx)(t.thead,{children:(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.th,{children:"Parameter"}),(0,s.jsx)(t.th,{children:"Description"}),(0,s.jsx)(t.th,{children:"Required"})]})}),(0,s.jsxs)(t.tbody,{children:[(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Target Name"}),(0,s.jsx)(t.td,{children:"Name of the target"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Packet Name"}),(0,s.jsx)(t.td,{children:"Name of the packet"}),(0,s.jsx)(t.td,{children:"True"})]}),(0,s.jsxs)(t.tr,{children:[(0,s.jsx)(t.td,{children:"Item Name"}),(0,s.jsx)(t.td,{children:"Name of the telemetry item to add to the group"}),(0,s.jsx)(t.td,{children:"True"})]})]})]}),"\n",(0,s.jsx)(t.p,{children:"Example Usage:"}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:"LIMITS_GROUP SUBSYSTEM\n LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP1\n LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP2\n LIMITS_GROUP_ITEM INST HEALTH_STATUS TEMP3\n"})}),"\n",(0,s.jsx)(t.h2,{id:"example-file",children:"Example File"}),"\n",(0,s.jsx)(t.p,{children:(0,s.jsx)(t.strong,{children:"Example File: TARGET/cmd_tlm/tlm.txt"})}),"\n",(0,s.jsx)(t.pre,{children:(0,s.jsx)(t.code,{className:"language-ruby",children:'TELEMETRY TARGET HS BIG_ENDIAN "Health and Status for My Target"\n ITEM CCSDSVER 0 3 UINT "CCSDS PACKET VERSION NUMBER (SEE CCSDS 133.0-B-1)"\n ITEM CCSDSTYPE 3 1 UINT "CCSDS PACKET TYPE (COMMAND OR TELEMETRY)"\n STATE TLM 0\n STATE CMD 1\n ITEM CCSDSSHF 4 1 UINT "CCSDS SECONDARY HEADER FLAG"\n STATE FALSE 0\n STATE TRUE 1\n ID_ITEM CCSDSAPID 5 11 UINT 102 "CCSDS APPLICATION PROCESS ID"\n ITEM CCSDSSEQFLAGS 16 2 UINT "CCSDS SEQUENCE FLAGS"\n STATE FIRST 0\n STATE CONT 1\n STATE LAST 2\n STATE NOGROUP 3\n ITEM CCSDSSEQCNT 18 14 UINT "CCSDS PACKET SEQUENCE COUNT"\n ITEM CCSDSLENGTH 32 16 UINT "CCSDS PACKET DATA LENGTH"\n ITEM CCSDSDAY 48 16 UINT "DAYS SINCE EPOCH (JANUARY 1ST, 1958, MIDNIGHT)"\n ITEM CCSDSMSOD 64 32 UINT "MILLISECONDS OF DAY (0 - 86399999)"\n ITEM CCSDSUSOMS 96 16 UINT "MICROSECONDS OF MILLISECOND (0-999)"\n ITEM ANGLEDEG 112 16 INT "Instrument Angle in Degrees"\n POLY_READ_CONVERSION 0 57.295\n ITEM MODE 128 8 UINT "Instrument Mode"\n STATE NORMAL 0 GREEN\n STATE DIAG 1 YELLOW\n ITEM TIMESECONDS 0 0 DERIVED "DERIVED TIME SINCE EPOCH IN SECONDS"\n GENERIC_READ_CONVERSION_START FLOAT 32\n ((packet.read(\'ccsdsday\') * 86400.0) + (packet.read(\'ccsdsmsod\') / 1000.0) + (packet.read(\'ccsdsusoms\') / 1000000.0) )\n GENERIC_READ_CONVERSION_END\n ITEM TIMEFORMATTED 0 0 DERIVED "DERIVED TIME SINCE EPOCH AS A FORMATTED STRING"\n GENERIC_READ_CONVERSION_START STRING 216\n time = Time.ccsds2mdy(packet.read(\'ccsdsday\'), packet.read(\'ccsdsmsod\'), packet.read(\'ccsdsusoms\'))\n sprintf(\'%04u/%02u/%02u %02u:%02u:%02u.%06u\', time[0], time[1], time[2], time[3], time[4], time[5], time[6])\n GENERIC_READ_CONVERSION_END\n'})})]})}function o(e={}){const{wrapper:t}={...(0,r.R)(),...e.components};return t?(0,s.jsx)(t,{...e,children:(0,s.jsx)(c,{...e})}):c(e)}},1184:(e,t,i)=>{i.d(t,{R:()=>l});var s=i(4041);const r={},n=s.createContext(r);function l(e){const t=s.useContext(n);return s.useMemo((function(){return"function"==typeof e?e(t):{...t,...e}}),[t,e])}}}]);