# `Sidereon.CCSDS.TDM`
[🔗](https://github.com/neilberkman/sidereon-ex/blob/main/lib/sidereon/ccsds/tdm.ex#L1)

Parse and encode CCSDS Tracking Data Messages (TDM) in KVN format.

Date/time fields are preserved as raw strings. Data record values carry both
the parsed `float` and the original decimal token so KVN round-trips do not
rewrite measurement text.

# `error`

```elixir
@type error() ::
  :missing_version
  | :no_segments
  | {:section, {String.t(), String.t()}}
  | {:malformed_line, {String.t(), String.t()}}
  | {:malformed_record, {String.t(), String.t()}}
  | {:invalid_field, {String.t(), String.t()}}
```

Failure reason from TDM parsing or encoding.

# `t`

```elixir
@type t() :: %Sidereon.CCSDS.TDM{
  comments: [String.t()],
  creation_date: String.t() | nil,
  header_fields: [Sidereon.CCSDS.TDM.Field.t()],
  message_id: String.t() | nil,
  originator: String.t() | nil,
  segments: [Sidereon.CCSDS.TDM.Segment.t()],
  version: String.t()
}
```

# `encode`

```elixir
@spec encode(t()) :: {:ok, String.t()} | {:error, error()}
```

Encode a TDM as KVN text.

# `encode_kvn`

```elixir
@spec encode_kvn(t()) :: {:ok, String.t()} | {:error, error()}
```

Encode a TDM as KVN text explicitly.

# `parse`

```elixir
@spec parse(String.t()) :: {:ok, t()} | {:error, error()}
```

Parse a TDM KVN document.

# `parse_kvn`

```elixir
@spec parse_kvn(String.t()) :: {:ok, t()} | {:error, error()}
```

Parse a TDM KVN document explicitly.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
