Compare commits
2 commits
364f9c7f31
...
64cf89b185
Author | SHA1 | Date | |
---|---|---|---|
Martin Brodbeck | 64cf89b185 | ||
Martin Brodbeck | 566983283a |
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -129,7 +129,6 @@ dependencies = [
|
|||
"reqwest",
|
||||
"serde",
|
||||
"serde_derive",
|
||||
"serde_json",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
name = "clrigctl"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
author = "Martin Brodbeck <info@rustysoft.de>"
|
||||
authors = ["Martin Brodbeck <dg2smb@darc.de>"]
|
||||
|
||||
[dependencies]
|
||||
config = { version = "0.13.4", features = ["yaml"] }
|
||||
|
@ -10,6 +10,5 @@ home = "0.5.5"
|
|||
reqwest = { version = "0.11.22", features = ["json","rustls"] }
|
||||
serde = { version = "1.0.193", features = ["serde_derive"] }
|
||||
serde_derive = "1.0.193"
|
||||
serde_json = "1.0.108"
|
||||
tokio = { version = "1.34.0", features = ["full"] }
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
use serde::Serialize;
|
||||
use serde_json;
|
||||
use reqwest::Client;
|
||||
|
||||
#[derive(Serialize)]
|
||||
|
@ -8,13 +7,10 @@ pub struct RadioData {
|
|||
pub radio: String,
|
||||
pub frequency : String,
|
||||
pub mode: String,
|
||||
pub power: String,
|
||||
}
|
||||
|
||||
#[tokio::main]
|
||||
pub async fn upload(url: &str, radio_data: &RadioData) {
|
||||
let radio_data_json = serde_json::to_string(radio_data).unwrap();
|
||||
|
||||
let res = Client::new().post(url).json(&radio_data_json).send().await.unwrap();
|
||||
|
||||
println!("{}", radio_data_json);
|
||||
}
|
||||
let _res = Client::new().post(url).json(&radio_data).send().await.unwrap();
|
||||
}
|
||||
|
|
|
@ -10,8 +10,9 @@ fn main() {
|
|||
let rd = RadioData {
|
||||
key: settings.cloudlog.key,
|
||||
radio: settings.cloudlog.identifier,
|
||||
frequency: String::from("2400170000"),
|
||||
frequency: String::from("14017000"),
|
||||
mode: String::from("CW"),
|
||||
power: String::from("5"),
|
||||
};
|
||||
|
||||
cloudlog::upload(&settings.cloudlog.url, &rd);
|
||||
|
|
Loading…
Reference in a new issue