# `Sidereon.GNSS.NMEA`
[🔗](https://github.com/neilberkman/sidereon-ex/blob/main/lib/sidereon/gnss/nmea.ex#L1)

NMEA 0183 parsing, epoch accumulation, and GGA writing.

# `accumulator`

```elixir
@spec accumulator(keyword()) ::
  {:ok, Sidereon.GNSS.NMEA.Accumulator.t()} | {:error, term()}
```

Create an incremental accumulator for chunked NMEA streams.

# `finish`

```elixir
@spec finish(Sidereon.GNSS.NMEA.Accumulator.t()) ::
  {:ok, Sidereon.GNSS.NMEA.Snapshot.t() | nil} | {:error, term()}
```

Finish an accumulator and return the trailing epoch, if any.

# `group_epochs`

```elixir
@spec group_epochs(String.t()) ::
  {:ok,
   %{
     sentences: [Sidereon.GNSS.NMEA.Sentence.t()],
     epochs: [Sidereon.GNSS.NMEA.Snapshot.t()],
     diagnostics: map()
   }}
```

Parse a text buffer and group decoded sentences into epochs.

# `parse`

```elixir
@spec parse(String.t()) ::
  {:ok, %{sentences: [Sidereon.GNSS.NMEA.Sentence.t()], diagnostics: map()}}
  | {:error, term()}
```

Forgiving parse of a text buffer into supported NMEA sentences.

# `parse_sentence`

```elixir
@spec parse_sentence(String.t()) ::
  {:ok, %{sentence: Sidereon.GNSS.NMEA.Sentence.t(), diagnostics: map()}}
  | {:error, term()}
```

Parse one NMEA sentence.

# `push`

```elixir
@spec push(Sidereon.GNSS.NMEA.Accumulator.t(), binary()) ::
  {:ok,
   %{
     sentences: [Sidereon.GNSS.NMEA.Sentence.t()],
     snapshots: [Sidereon.GNSS.NMEA.Snapshot.t()],
     diagnostics: map()
   }}
  | {:error, term()}
```

Push bytes into an accumulator.

# `retained_len`

```elixir
@spec retained_len(Sidereon.GNSS.NMEA.Accumulator.t()) :: non_neg_integer()
```

Number of retained partial-line bytes in an accumulator.

# `write_gga`

```elixir
@spec write_gga(keyword() | map()) :: {:ok, String.t()} | {:error, term()}
```

Write a GGA sentence from validated GGA fields.

---

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