[feat](trx-rs): add GetSatPasses protocol command for server-side TLE management
TLE refresh now happens only on trx-server (once at startup, then every 24h). Client fetches satellite predictions from server via new GetSatPasses fast-path command and caches them locally, refreshing every 5 minutes. Removes spawn_tle_refresh_task from trx-client. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> Signed-off-by: Stan Grams <sjg@haxx.space>
This commit is contained in:
@@ -263,6 +263,7 @@ mod tests {
|
||||
rig_id: Some("hf".to_string()),
|
||||
state: None,
|
||||
rigs: None,
|
||||
sat_passes: None,
|
||||
error: None,
|
||||
};
|
||||
let json = serde_json::to_string(&resp).unwrap();
|
||||
@@ -279,6 +280,7 @@ mod tests {
|
||||
rig_id: None,
|
||||
state: None,
|
||||
rigs: None,
|
||||
sat_passes: None,
|
||||
error: Some("bad".to_string()),
|
||||
};
|
||||
let json = serde_json::to_string(&resp).unwrap();
|
||||
@@ -296,6 +298,7 @@ mod tests {
|
||||
rig_id: Some("server".to_string()),
|
||||
state: None,
|
||||
rigs: None,
|
||||
sat_passes: None,
|
||||
error: None,
|
||||
};
|
||||
let json = serde_json::to_string(&resp).unwrap();
|
||||
|
||||
@@ -19,6 +19,9 @@ pub fn client_command_to_rig(cmd: ClientCommand) -> RigCommand {
|
||||
ClientCommand::GetRigs => {
|
||||
unreachable!("GetRigs is handled in the listener before reaching rig_task")
|
||||
}
|
||||
ClientCommand::GetSatPasses => {
|
||||
unreachable!("GetSatPasses is handled in the listener before reaching rig_task")
|
||||
}
|
||||
ClientCommand::GetState => RigCommand::GetSnapshot,
|
||||
ClientCommand::SetFreq { freq_hz } => RigCommand::SetFreq(Freq { hz: freq_hz }),
|
||||
ClientCommand::SetCenterFreq { freq_hz } => RigCommand::SetCenterFreq(Freq { hz: freq_hz }),
|
||||
|
||||
@@ -15,6 +15,7 @@ use trx_core::WfmDenoiseLevel;
|
||||
pub enum ClientCommand {
|
||||
GetState,
|
||||
GetRigs,
|
||||
GetSatPasses,
|
||||
SetFreq { freq_hz: u64 },
|
||||
SetCenterFreq { freq_hz: u64 },
|
||||
SetMode { mode: String },
|
||||
@@ -95,5 +96,8 @@ pub struct ClientResponse {
|
||||
/// Populated only for GetRigs responses.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub rigs: Option<Vec<RigEntry>>,
|
||||
/// Populated only for GetSatPasses responses.
|
||||
#[serde(default, skip_serializing_if = "Option::is_none")]
|
||||
pub sat_passes: Option<trx_core::geo::PassPredictionResult>,
|
||||
pub error: Option<String>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user