|
libSDRForge
|
Serialize receiver lifecycle transitions across concurrent clients. More...
Public Member Functions | |
| None | __init__ (self, ReceiverControlIf receiver) |
| Initialize the instance. | |
| ReceiverState | state (self) |
| Return the state. | |
| str|None | last_error (self) |
| Return the last error. | |
| None | start (self) |
| Start the component. | |
| None | stop (self) |
| Stop the component. | |
| None | report_disconnect (self, str reason="receiver disconnected") |
| Mark a lost receiver and attempt to release its resources. | |
| None | restart (self) |
| Restart the component. | |
| None | set_frequency (self, int hz) |
| Set the frequency. | |
| int | get_frequency (self) |
| Return the frequency. | |
| None | set_mode (self, str mode, int bandwidth) |
| Set the mode. | |
| tuple[str, int] | get_mode (self) |
| Return the mode. | |
| float|None | get_signal_strength (self) |
| Return the signal strength. | |
| float|None | get_snr (self) |
| Return the snr. | |
| str|None | get_rds (self) |
| Return the rds. | |
Protected Attributes | |
| _receiver = receiver | |
| _lock = RLock() | |
| _state = ReceiverState.STOPPED | |
| str|None | _last_error = None |
Serialize receiver lifecycle transitions across concurrent clients.
The injected receiver is the sole hardware owner. This service never opens a second device and can be exercised with a fake receiver.
| None receiver_service.ReceiverService.__init__ | ( | self, | |
| ReceiverControlIf | receiver ) |
Initialize the instance.
| self | The current instance. |
| receiver | The receiver value. |
| int receiver_service.ReceiverService.get_frequency | ( | self | ) |
Return the frequency.
| self | The current instance. |
| tuple[str, int] receiver_service.ReceiverService.get_mode | ( | self | ) |
Return the mode.
| self | The current instance. |
| str | None receiver_service.ReceiverService.get_rds | ( | self | ) |
Return the rds.
| self | The current instance. |
| float | None receiver_service.ReceiverService.get_signal_strength | ( | self | ) |
Return the signal strength.
| self | The current instance. |
| float | None receiver_service.ReceiverService.get_snr | ( | self | ) |
Return the snr.
| self | The current instance. |
| str | None receiver_service.ReceiverService.last_error | ( | self | ) |
Return the last error.
| self | The current instance. |
| None receiver_service.ReceiverService.report_disconnect | ( | self, | |
| str | reason = "receiver disconnected" ) |
Mark a lost receiver and attempt to release its resources.
Safe to call from a hardware monitoring thread. A subsequent stop() retries cleanup, and only a successful cleanup permits restart.
| self | The current instance. |
| reason | The reason value. |
| None receiver_service.ReceiverService.restart | ( | self | ) |
Restart the component.
| self | The current instance. |
| None receiver_service.ReceiverService.set_frequency | ( | self, | |
| int | hz ) |
Set the frequency.
| self | The current instance. |
| hz | The hz value. |
| None receiver_service.ReceiverService.set_mode | ( | self, | |
| str | mode, | ||
| int | bandwidth ) |
Set the mode.
| self | The current instance. |
| mode | The demodulation mode. |
| bandwidth | The channel bandwidth in hertz. |
| None receiver_service.ReceiverService.start | ( | self | ) |
Start the component.
| self | The current instance. |
| ReceiverState receiver_service.ReceiverService.state | ( | self | ) |
Return the state.
| self | The current instance. |
| None receiver_service.ReceiverService.stop | ( | self | ) |
Stop the component.
| self | The current instance. |
|
protected |
|
protected |
|
protected |
|
protected |