@@ -23,8 +23,9 @@ use crate::config::Config;
23
23
use crate :: errors:: WavelogHamlibError ;
24
24
use crate :: wavelog:: Update ;
25
25
use clap:: Parser ;
26
- use hamlib_client:: adif:: Mode ;
26
+ use hamlib_client:: adif:: { Mode , PropagationMode } ;
27
27
use hamlib_client:: RigCtlClient ;
28
+ use std:: string:: String ;
28
29
use std:: time:: Duration ;
29
30
use tokio:: time:: sleep;
30
31
@@ -76,16 +77,33 @@ async fn program(configuration: &Config) -> Result<(), WavelogHamlibError> {
76
77
let tx_freq = rigctl. get_split_freq ( rx_vfo) . await ?;
77
78
log:: trace!( "{}: {}" , & tx_vfo, & tx_freq) ;
78
79
80
+ let update_prop_mode =
81
+ if !& configuration. sat . is_empty ( ) {
82
+ log:: debug!( "Enabling SAT propagation mode" ) ;
83
+ Some ( PropagationMode :: SAT )
84
+ } else {
85
+ None
86
+ } ;
87
+
88
+ let update_tx_freq =
89
+ if & configuration. sat == "QO-100"
90
+ && tx_freq. frequency == rx_freq. frequency {
91
+ log:: debug!( "Manually setting TX Frequency for QO-100 satellite activity" ) ;
92
+ tx_freq. frequency - 8089500000
93
+ } else {
94
+ tx_freq. frequency
95
+ } ;
96
+
79
97
log:: debug!( "Preparing update" ) ;
80
98
let update = Update {
81
99
radio : String :: from ( & configuration. wavelog_radio ) ,
82
- frequency : tx_freq . frequency ,
100
+ frequency : update_tx_freq ,
83
101
mode : Mode :: from ( tx_mode. mode ) ,
84
102
frequency_rx : Some ( rx_freq. frequency ) ,
85
103
mode_rx : Some ( Mode :: from ( rx_mode. mode ) ) ,
86
- prop_mode : None ,
104
+ prop_mode : update_prop_mode ,
87
105
power : None ,
88
- sat_name : None ,
106
+ sat_name : Some ( String :: from ( & configuration . sat ) ) . filter ( String :: is_empty ) ,
89
107
} ;
90
108
log:: trace!( "Update: {}" , & update) ;
91
109
0 commit comments