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

NTRIP client helpers and stream process.

Protocol handling is delegated to the core sans-I/O machine through the NIF.
This module owns transport, reconnect timing, and delivery of opaque payload
bytes or decoded RTCM messages. User-supplied NTRIP endpoints are not checked
against the archive host allowlist; redirects are classified as terminal
protocol rejections and are never followed.

Basic credentials over plain TCP are sent in cleartext. Use `tls: true` when
the caster supports it.

# `error_reason`

```elixir
@type error_reason() ::
  :unauthorized
  | :digest_not_supported
  | {:mountpoint_not_found, Sidereon.GNSS.Ntrip.Sourcetable.t() | nil}
  | {:caster_error, String.t()}
  | {:http_status, non_neg_integer(), String.t()}
  | {:unexpected_content_type, String.t()}
  | {:protocol, term()}
  | {:network, term()}
  | {:stream_stalled, number()}
```

# `format_gga`

Format one NMEA GGA sentence for a VRS feed.

# `ntrip_request_bytes`

```elixir
@spec ntrip_request_bytes(
  String.t(),
  keyword()
) :: {:ok, binary()} | {:error, error_reason()}
```

Alias for `request_bytes/2`, matching the canonical facade function name.

# `parse_sourcetable`

Parse sourcetable bytes through the core parser.

# `request_bytes`

```elixir
@spec request_bytes(
  String.t(),
  keyword()
) :: {:ok, binary()} | {:error, error_reason()}
```

Build the raw NTRIP request bytes for a host and option set.

The options match `sourcetable/2` and `Ntrip.Stream.start_link/1`: `:mountpoint`,
`:port`, `:version`, `:credentials`, `:user_agent_product`, and `:gga`.
This is the public sans-I/O request builder used by the stream and raw
sourcetable flows.

# `sourcetable`

```elixir
@spec sourcetable(
  String.t(),
  keyword()
) :: {:ok, Sidereon.GNSS.Ntrip.Sourcetable.t()} | {:error, error_reason()}
```

Fetch and parse a caster sourcetable.

# `sourcetable_to_text`

Serialize a parsed sourcetable through the core serializer.

# `stream`

Return an Elixir stream of payload binaries from a started NTRIP stream process.

---

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