Raxol.Sensor.Feed
(Raxol v2.3.0)
View Source
GenServer managing a single sensor's polling lifecycle.
Connects to a sensor module, polls at the configured sample rate, buffers readings in a CircularBuffer, and forwards each reading to the fusion process.
Summary
Functions
Returns a specification to start this module under a supervisor.
Types
@type status() :: :connecting | :running | :error | :stopped
@type t() :: %Raxol.Sensor.Feed{ backoff_ref: reference() | nil, buffer: CircularBuffer.t(), buffer_size: pos_integer(), connect_opts: keyword(), error_count: non_neg_integer(), fusion_pid: pid() | nil, max_errors: pos_integer(), module: module(), poll_ref: reference() | nil, sample_rate_ms: pos_integer(), sensor_id: atom(), sensor_state: term(), status: status() }
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec get_history(GenServer.server(), pos_integer()) :: [map()]
@spec get_latest(GenServer.server()) :: {:ok, map()} | {:error, :empty}
@spec get_status(GenServer.server()) :: status()
@spec reconnect(GenServer.server()) :: :ok
@spec start_link(keyword()) :: GenServer.on_start()