Handling changing telemetry? #148
Replies: 1 comment
|
Hi Joey, a few people have had to do this before and the most common solution is to do two passes, where the first pass parses just enough to get the version ID, and then the second pass is done with the correct packet type for the detected version. If you have one version per APID stream (ie, it doesn't bounce around versions within the same file), you would do the first pass on the entire stream with a packet definition that includes a packet field to parse the version number, and leaves the rest of the packet as an expanding field. Expanding fields will grow to the length of the packet. Based on the version you get from the first pass, you'd then reparse a second time with the final packet definition for the detected packet version. filename = "myfile.bin"
first_pass_fields = detect_version_packet_defs.load(filename )
if first_pass_fields['version'][0] == 1:
final_fields = version1_packet_defs.load(filename)
else:
final_fields = version2_packet_defs.load(filename)If you have mixed versions per APID stream, you can use utils.split_packet_bytes() to split the data stream into a list of bytes for each packet, and then do the two-pass solution on a per packet basis, parsing one packet at a time. Does this help? Let me know if you have any other questions. |
Uh oh!
There was an error while loading. Please reload this page.
How do you all handle when telemetry changes? I have a packet version in my telemetry and when it is 1, I have one set of telemetry and when it is 2, I have a different one. However, I need to parse the telemetry first to get that value. Is there a best practice here?
All reactions