diff --git a/sphinx-key/Cargo.lock b/sphinx-key/Cargo.lock index 971db3f..1aaf065 100644 --- a/sphinx-key/Cargo.lock +++ b/sphinx-key/Cargo.lock @@ -613,12 +613,10 @@ dependencies = [ "embedded-io-async", "enumset", "heapless", - "log", "no-std-net", "num_enum", "serde", "strum 0.25.0", - "strum_macros 0.25.3", ] [[package]] @@ -652,7 +650,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e875f1719c16de097dee81ed675e2d9bb63096823ed3f0ca827b7dea3028bbbb" dependencies = [ "enumset_derive", - "serde", ] [[package]] @@ -937,7 +934,6 @@ dependencies = [ "atomic-polyfill", "hash32", "rustc_version", - "serde", "spin", "stable_deref_trait", ] @@ -1240,9 +1236,6 @@ name = "no-std-net" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bcece43b12349917e096cddfa66107277f123e6c96a5aea78711dc601a47152" -dependencies = [ - "serde", -] [[package]] name = "nom" @@ -1774,8 +1767,6 @@ version = "0.1.0" dependencies = [ "anyhow", "bitflags", - "embedded-hal 1.0.0-rc.1", - "embedded-svc", "embuild", "esp-idf-svc", "hex", diff --git a/sphinx-key/Cargo.toml b/sphinx-key/Cargo.toml index 42e0700..6447e7f 100644 --- a/sphinx-key/Cargo.toml +++ b/sphinx-key/Cargo.toml @@ -31,8 +31,6 @@ sphinx-signer = { git = "https://github.com/stakwork/sphinx-rs.git", optional = anyhow = { version = "1", features = ["backtrace"] } bitflags = "1.3.2" -embedded-hal = "=1.0.0-rc.1" -embedded-svc = "0.26.1" esp-idf-svc = { version = "0.47.1", features = ["experimental", "alloc", "binstart"] } log = "0.4.17" diff --git a/sphinx-key/src/clear.rs b/sphinx-key/src/clear.rs index a9dc99a..bce666f 100644 --- a/sphinx-key/src/clear.rs +++ b/sphinx-key/src/clear.rs @@ -9,7 +9,6 @@ use crate::periph::sd::mount_sd_card; use esp_idf_svc as _; // If using the `binstart` feature of `esp-idf-sys`, always keep this module imported -// use embedded_svc::storage::StorageBase; // use esp_idf_svc::nvs::EspNvs; // use esp_idf_svc::nvs::*; diff --git a/sphinx-key/src/conn/mqtt.rs b/sphinx-key/src/conn/mqtt.rs index 85dbc6d..3e19cb0 100644 --- a/sphinx-key/src/conn/mqtt.rs +++ b/sphinx-key/src/conn/mqtt.rs @@ -2,8 +2,6 @@ use crate::core::events::Event as CoreEvent; use sphinx_signer::sphinx_glyph::topics; use anyhow::Result; -// use embedded_svc::utils::mqtt::client::Connection as MqttConnection; -// use embedded_svc::utils::mutex::Condvar; use esp_idf_svc::mqtt::client::*; use esp_idf_svc::sys::EspError; use log::*; diff --git a/sphinx-key/src/core/events.rs b/sphinx-key/src/core/events.rs index 9815e82..2d17c40 100644 --- a/sphinx-key/src/core/events.rs +++ b/sphinx-key/src/core/events.rs @@ -20,7 +20,6 @@ use std::sync::mpsc; use std::sync::Arc; use std::thread; -// use embedded_svc::mqtt::client::Client; use esp_idf_svc::mqtt::client::*; use esp_idf_svc::sys::EspError; diff --git a/sphinx-key/src/ota.rs b/sphinx-key/src/ota.rs index 41a17a4..4e288f9 100644 --- a/sphinx-key/src/ota.rs +++ b/sphinx-key/src/ota.rs @@ -1,9 +1,9 @@ use crate::status::Status; use anyhow::{anyhow, Result}; -use embedded_svc::http::client::Client; use esp_idf_svc::http::client::Configuration; use esp_idf_svc::http::client::EspHttpConnection; use esp_idf_svc::http::client::FollowRedirectsPolicy::FollowNone; +use esp_idf_svc::http::Method; use esp_idf_svc::ota::EspOta; use log::{error, info}; use sphinx_signer::sphinx_glyph::control::OtaParams; @@ -36,9 +36,10 @@ fn get_update(params: OtaParams, led_tx: mpsc::Sender) -> Result<()> { use_global_ca_store: true, ..Default::default() }; - let mut client = Client::wrap(EspHttpConnection::new(&configuration)?); + let mut reader = EspHttpConnection::new(&configuration)?; let full_url = params_to_url(params); - let mut reader = client.get(&full_url)?.submit()?; + reader.initiate_request(Method::Get, &full_url, &[])?; + reader.initiate_response()?; // let mut reader = response.reader(); let _ = remove_file(UPDATE_BIN_PATH); @@ -86,11 +87,12 @@ pub fn validate_ota_message(params: OtaParams) -> Result<()> { use_global_ca_store: true, ..Default::default() }; - let mut client = Client::wrap(EspHttpConnection::new(&configuration)?); + let mut reader = EspHttpConnection::new(&configuration)?; let full_url = params_to_url(params); info!("Pinging this url for an update: {}", full_url); - let response = client.get(&full_url)?.submit()?; - let status = response.status(); + reader.initiate_request(Method::Get, &full_url, &[])?; + reader.initiate_response()?; + let status = reader.status(); if status == 200 { info!("Got valid OTA url! Proceeding with OTA update..."); Ok(())