proof of concept
This commit is contained in:
parent
d2b4092cd7
commit
a617025d5c
5 changed files with 111 additions and 63 deletions
11
src/main.rs
11
src/main.rs
|
@ -1,5 +1,6 @@
|
|||
mod cloudlog;
|
||||
mod settings;
|
||||
mod flrig;
|
||||
|
||||
use settings::Settings;
|
||||
use crate::cloudlog::RadioData;
|
||||
|
@ -7,7 +8,7 @@ use crate::cloudlog::RadioData;
|
|||
fn main() {
|
||||
let settings = Settings::new().expect("Could not read settings.");
|
||||
|
||||
let rd = RadioData {
|
||||
let mut radio_data_current = RadioData {
|
||||
key: settings.cloudlog.key,
|
||||
radio: settings.cloudlog.identifier,
|
||||
frequency: String::from("14017000"),
|
||||
|
@ -15,5 +16,11 @@ fn main() {
|
|||
power: String::from("5"),
|
||||
};
|
||||
|
||||
cloudlog::upload(&settings.cloudlog.url, &rd);
|
||||
let radio_data_new = flrig::get_radio_data(&settings.flrig.host, &settings.flrig.port).unwrap();
|
||||
|
||||
radio_data_current.frequency = radio_data_new.frequency;
|
||||
radio_data_current.mode = radio_data_new.mode;
|
||||
radio_data_current.power = radio_data_new.power;
|
||||
|
||||
cloudlog::upload(&settings.cloudlog.url, &radio_data_current);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue