diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 0000000..ca8db61 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,14 @@ +[package] +name = "unicorn" +version = "0.1.0" +edition = "2021" + +# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html + +[dependencies] +unicorn_hat_hd_2 = { version = "*" } +#unicorn_hat_hd_2 = { version = "*", default-features = false, features = [ "fake-hardware" ] } +url = "*" +reqwest = "*" +trust-dns-client = "*" + diff --git a/src/main.rs b/src/main.rs new file mode 100644 index 0000000..6b8b12a --- /dev/null +++ b/src/main.rs @@ -0,0 +1,54 @@ +use unicorn_hat_hd_2::UnicornHatHd; +use url::Url; + +use std::net::SocketAddr; + +pub trait Probe { + fn execute() -> ProbeResult; +} + +pub struct ProbeResult { + pub status: ProbeStatus, + pub metrics: ProbeMetrics +} + +pub enum ProbeStatus { + Ok, + NotReady, +} + +pub struct ProbeMetrics { + pub latency_ms: u32 +} + +// HTTP probe +// +pub struct HttpProbe { + remote_addr: SocketAddr +} + +impl Probe for HttpProbe { + fn execute() -> ProbeResult { + unimplemented!(); + } +} + +// DNS probe + +pub struct DnsProbe { + fn execute() -> ProbeResult { + unimplemented!(); + } +} + +fn main() { + let mut hat_hd = UnicornHatHd::default(); + + hat_hd.clear_pixels(); + hat_hd.display().unwrap(); + + //hat_hd.set_pixel(x, y, [255, 255, 255].into()); + //hat_hd.display().unwrap(); + +} +