Skip to main content

read

Function read 

Source
pub fn read(text: &str) -> Result<FlightLog, LogError>
Expand description

Reads an AltOS .eeprom file.

§Errors

  • LogError::NotThisFormat for a file in neither form.
  • LogError::NoData for a file with no records: none after the configuration, or in the JSON form only erased memory.
  • LogError::Syntax, with the line, for a fault in the text form or in the JSON form’s head: a log format the reader doesn’t know (named by number) or none for a product other than a TeleMetrum v1, a malformed line, a configuration whose copies differ, a token in the memory that isn’t two hexadecimal digits.
  • LogError::Binary, with the byte, for a fault in the JSON form’s memory: a record whose checksum fails, a record after erased memory, memory that ends partway through a record.
  • For a fault in the records themselves, either, at the record (a line of the text form, a byte of the JSON form’s memory): no flight record or two; the pad’s pressure outside a launch site’s or away from the flight record’s; the pad’s temperature outside the barometer’s operating range. The climb check never refuses a file: failing it, or a first second after boost too short to measure, keeps the acceleration’s counts as written (and a TeleMetrum v1’s pressure’s), with a note.