OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
radio.radio_controller_if.RadioControllerIf Class Reference

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

Inheritance diagram for radio.radio_controller_if.RadioControllerIf:
radio.radio_controller.RadioController radio.unconfigured_radio_controller.UnconfiguredRadioController 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.
Sequence[RadioPreset] presets (self)
 Return configured radio presets.
int start (self)
 Start the receiver and return its initial frequency.
None stop (self)
 Stop the receiver.
int get_frequency (self)
 Return the controller's current frequency in hertz.
int refresh_frequency (self)
 Refresh the current frequency from the receiver backend.
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 configured preset by wrapping index.
RadioPreset next_preset (self)
 Tune and return the next preset.
RadioPreset previous_preset (self)
 Tune and return the previous preset.
RadioPreset next_station (self)
 Compatibility name for tuning the next preset.
RadioPreset previous_station (self)
 Compatibility name for tuning the previous preset.
int frequency_up (self, int|None delta_hz=None)
 Increase frequency by an explicit or mode-defined step.
int frequency_down (self, int|None delta_hz=None)
 Decrease frequency by an explicit or mode-defined step.
int set_frequency (self, int frequency_hz)
 Tune and return a validated frequency in hertz.
float|str|None get_signal_strength (self)
 Return receiver signal strength when available.
float|str|None get_snr (self)
 Return receiver signal-to-noise ratio when available.
str|None get_rds (self)
 Return decoded Radio Data System text when available.

Detailed Description

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

Member Function Documentation

◆ frequency_down()

int radio.radio_controller_if.RadioControllerIf.frequency_down ( self,
int | None delta_hz = None )

Decrease frequency by an explicit or mode-defined step.

Parameters
delta_hzExplicit positive step in hertz, or None to use the active mode's configured step.
Returns
Resulting tuned frequency in hertz.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ frequency_up()

int radio.radio_controller_if.RadioControllerIf.frequency_up ( self,
int | None delta_hz = None )

Increase frequency by an explicit or mode-defined step.

Parameters
delta_hzExplicit positive step in hertz, or None to use the active mode's configured step.
Returns
Resulting tuned frequency in hertz.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ get_frequency()

int radio.radio_controller_if.RadioControllerIf.get_frequency ( self)

Return the controller's current frequency in hertz.

Returns
Current tuned frequency in hertz.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ get_rds()

str | None radio.radio_controller_if.RadioControllerIf.get_rds ( self)

Return decoded Radio Data System text when available.

Returns
Decoded RDS text, or None when unavailable.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ get_signal_strength()

float | str | None radio.radio_controller_if.RadioControllerIf.get_signal_strength ( self)

Return receiver signal strength when available.

Returns
Signal strength reported by the backend, or None when unavailable.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ get_snr()

float | str | None radio.radio_controller_if.RadioControllerIf.get_snr ( self)

Return receiver signal-to-noise ratio when available.

Returns
Signal-to-noise ratio reported by the backend, or None when unavailable.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ is_available()

bool radio.radio_controller_if.RadioControllerIf.is_available ( self)

Return whether radio control is configured and available.

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

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ is_started()

bool radio.radio_controller_if.RadioControllerIf.is_started ( self)

Return whether the receiver backend is started.

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

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ next_preset()

RadioPreset radio.radio_controller_if.RadioControllerIf.next_preset ( self)

Tune and return the next preset.

Returns
Newly tuned preset.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ next_station()

RadioPreset radio.radio_controller_if.RadioControllerIf.next_station ( self)

Compatibility name for tuning the next preset.

Returns
Newly tuned preset.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ presets()

Sequence[RadioPreset] radio.radio_controller_if.RadioControllerIf.presets ( self)

Return configured radio presets.

Returns
Ordered configured radio presets.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ previous_preset()

RadioPreset radio.radio_controller_if.RadioControllerIf.previous_preset ( self)

Tune and return the previous preset.

Returns
Newly tuned preset.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ previous_station()

RadioPreset radio.radio_controller_if.RadioControllerIf.previous_station ( self)

Compatibility name for tuning the previous preset.

Returns
Newly tuned preset.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ refresh_frequency()

int radio.radio_controller_if.RadioControllerIf.refresh_frequency ( self)

Refresh the current frequency from the receiver backend.

Returns
Refreshed tuned frequency in hertz.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ set_frequency()

int radio.radio_controller_if.RadioControllerIf.set_frequency ( self,
int frequency_hz )

Tune and return a validated frequency in hertz.

Parameters
frequency_hzTarget frequency in hertz.
Returns
Validated tuned frequency in hertz.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ set_mode()

RadioMode radio.radio_controller_if.RadioControllerIf.set_mode ( self,
RadioMode mode )

Set and return the active demodulation mode.

Parameters
modeDemodulation mode to activate.
Returns
Active demodulation mode.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ start()

int radio.radio_controller_if.RadioControllerIf.start ( self)

Start the receiver and return its initial frequency.

Returns
Initial tuned frequency in hertz.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ status_message()

str | None radio.radio_controller_if.RadioControllerIf.status_message ( self)

Return an availability message, if one applies.

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

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ tune_preset()

RadioPreset radio.radio_controller_if.RadioControllerIf.tune_preset ( self,
RadioPreset preset )

Tune and return a preset.

Parameters
presetPreset to tune.
Returns
Tuned preset.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.

◆ tune_preset_index()

RadioPreset radio.radio_controller_if.RadioControllerIf.tune_preset_index ( self,
int index )

Tune a configured preset by wrapping index.

Parameters
indexPreset index, wrapped into the configured preset list.
Returns
Tuned preset.

Reimplemented in radio.radio_controller.RadioController, and radio.unconfigured_radio_controller.UnconfiguredRadioController.


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