BallAerospace / COSMOS

Ball Aerospace COSMOS
https://ballaerospace.github.io/cosmos-website/
Other
360 stars 127 forks source link

Variable Header Size #275

Closed AstroTrek closed 8 years ago

AstroTrek commented 8 years ago

Occasionally, one of the CubeSats our COSMOS software communicates with has a variable header size.

Is there any way to set up the telemetry script to look for a specific value in the header of a downlinked telemetry packet? That way, when a header character or data item appears, the rest of the telemetry items will be generated after this item using append_item. Or must the telemetry script always be required to have an exact header bit size in order to have a proper arrangement of all telemetry packet items?

jmthomas commented 8 years ago

I would recommend creating multiple packets with all your unique telemetry header values and then using partials to define the common stuff. This isn't well documented on our site but we have an example in the INST target of the demo.

The convention is to define all the common stuff in a file named with an underscore like "_ccsds_tlm.txt". Then in your other telemetry definition file "tlm.txt" you can include it like so: <%= render "_ccsds_tlm.txt", locals: {apid: 1} %>

You'll notice I'm passing a value to make the common stuff a little more dynamic. It's used like so: APPEND_ID_ITEM CCSDSAPID 11 UINT <%= apid %> "CCSDS application process id"

It's exactly the way ERB is processed in Rails if you're familiar with that concept.