OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
radio.radio_controller.RadioController Class Reference

Coordinate radio tuning, modes, presets, and receiver telemetry. More...

Inheritance diagram for radio.radio_controller.RadioController:
radio.radio_controller_if.RadioControllerIf radio.radio_controller_stub.RadioControllerStub

Public Member Functions

bool is_started (self)
 Return whether the receiver backend is started.
bool is_available (self)
 Return whether radio control is configured and available.
str|None status_message (self)
 Return an availability message, if one applies.
list[RadioPreset] presets (self)
 Return configured radio presets.
int start (self)
 Start the backend and tune the configured initial frequency.
None stop (self)
 Stop the radio backend.
int get_frequency (self)
 Return the controller's current frequency without transport I/O.
int refresh_frequency (self)
 Read the current frequency from the backend and synchronize state.
RadioMode set_mode (self, RadioMode mode)
 Set and return the active demodulation mode.
RadioPreset tune_preset (self, RadioPreset preset)
 Tune and return a preset.
RadioPreset tune_preset_index (self, int index)
 Tune a preset by zero-based index, wrapping at either end.
RadioPreset next_preset (self)
 Tune and return the next configured preset.
RadioPreset previous_preset (self)
 Tune and return the previous configured preset.
RadioPreset next_station (self)
 Compatibility alias used by existing radio panels and adapters.
RadioPreset previous_station (self)
 Compatibility alias used by existing radio panels and adapters.
int frequency_up (self, int|None delta_hz=None)
 Increase frequency by an explicit delta or the active mode step.
int frequency_down (self, int|None delta_hz=None)
 Decrease frequency by an explicit delta or the active mode step.
int set_frequency (self, int frequency_hz)
 Tune a validated frequency and return the resulting hertz value.
float|str|None get_signal_strength (self)
 Return backend signal strength, or None when unavailable.
float|str|None get_snr (self)
 Return backend signal-to-noise ratio, or None when unavailable.
str|None get_rds (self)
 Return decoded RDS text, or None when unavailable.

Detailed Description

Coordinate radio tuning, modes, presets, and receiver telemetry.

Member Function Documentation

◆ is_available()

bool radio.radio_controller.RadioController.is_available ( self)

Return whether radio control is configured and available.

Return values
TrueRadio control is available.
FalseRadio control is unavailable.

Reimplemented from radio.radio_controller_if.RadioControllerIf.

◆ is_started()

bool radio.radio_controller.RadioController.is_started ( self)

Return whether the receiver backend is started.

Return values
TrueThe receiver backend is started.
FalseThe receiver backend is stopped.

Reimplemented from radio.radio_controller_if.RadioControllerIf.

◆ presets()

list[RadioPreset] radio.radio_controller.RadioController.presets ( self)

Return configured radio presets.

Returns
Ordered configured radio presets.

Reimplemented from radio.radio_controller_if.RadioControllerIf.

◆ status_message()

str | None radio.radio_controller.RadioController.status_message ( self)

Return an availability message, if one applies.

Returns
Human-readable status, or None when no message applies.

Reimplemented from radio.radio_controller_if.RadioControllerIf.


The documentation for this class was generated from the following file:
  • controllers/radio/radio_controller.py