# `XMAVLink.Util.CacheManager`
[🔗](https://github.com/fancydrones/xmavlink/blob/main/lib/mavlink_util/cache_manager.ex#L1)

Populate and keep updated a set of protected ETS tables representing:

- the visible MAV systems
- the most recently received messages for each MAV and message type
- the most recently received set of parameters for each MAV

Using ETS tables allows read-heavy utility queries without turning this
GenServer into a bottleneck. Prefer this module's query functions over direct
ETS access; table contents are internal cache structs.

Use `XMAVLink.Util.Context` when utility state should be scoped to a
specific router, dialect, or ETS table namespace.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `get_param`

```elixir
@spec get_param(non_neg_integer(), non_neg_integer(), atom() | String.t(), keyword()) ::
  {:ok, non_neg_integer(), XMAVLink.Message.t()}
  | {:error, :not_started | :no_such_param}
```

Return one cached MAVLink parameter by name.

Parameter names are normalized to uppercase before lookup, matching
`XMAVLink.Util.ParamSet` behavior.

# `latest_message`

```elixir
@spec latest_message(non_neg_integer(), non_neg_integer(), module(), keyword()) ::
  {:ok, non_neg_integer(), XMAVLink.Message.t()}
  | {:error, :not_started | :no_such_message}
```

Return the latest cached message for a MAVLink system/component pair.

The result is `{:ok, age_ms, message}` where `age_ms` is the monotonic age of
the cached message at read time.

# `list_systems`

```elixir
@spec list_systems(keyword()) ::
  {:ok, [{XMAVLink.Types.mavlink_address(), XMAVLink.Util.Cache.System.t()}]}
  | {:error, :not_started}
```

Return visible MAVLink systems from the utility cache.

This is the public query API for the utility systems table. Each entry is
returned as `{system_component_id, cached_system}` where
`system_component_id` is `{system_id, component_id}`.

# `mavs`

# `msg`

# `msg`

# `msg`

# `msg`

# `params`

# `params`

# `params`

# `params`

# `router`

# `start_link`

---

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