mqtt via mcutie
This commit is contained in:
@@ -119,7 +119,7 @@ where
|
||||
let mut offset = 0_usize;
|
||||
let mut buf = [0_u8; 32];
|
||||
|
||||
let mut checksum = crate::hal::rtc::X25.digest();
|
||||
let mut checksum = X25.digest();
|
||||
|
||||
let mut counter = 0;
|
||||
loop {
|
||||
|
||||
@@ -48,7 +48,7 @@ where
|
||||
Some(200)
|
||||
}
|
||||
Method::Get => {
|
||||
let disp = format!("attachment; filename=\"{filename}\"");
|
||||
let disposition = format!("attachment; filename=\"{filename}\"");
|
||||
let size = {
|
||||
let mut board = BOARD_ACCESS.get().await.lock().await;
|
||||
board
|
||||
@@ -63,7 +63,7 @@ where
|
||||
Some("OK"),
|
||||
&[
|
||||
("Content-Type", "application/octet-stream"),
|
||||
("Content-Disposition", disp.as_str()),
|
||||
("Content-Disposition", disposition.as_str()),
|
||||
("Content-Length", &format!("{}", size)),
|
||||
("Access-Control-Allow-Origin", "*"),
|
||||
("Access-Control-Allow-Headers", "*"),
|
||||
@@ -75,7 +75,7 @@ where
|
||||
let mut chunk = 0;
|
||||
loop {
|
||||
let mut board = BOARD_ACCESS.get().await.lock().await;
|
||||
board.board_hal.progress(chunk as u32).await;
|
||||
board.board_hal.progress(chunk).await;
|
||||
let read_chunk = board
|
||||
.board_hal
|
||||
.get_esp()
|
||||
@@ -107,7 +107,7 @@ where
|
||||
Method::Post => {
|
||||
{
|
||||
let mut board = BOARD_ACCESS.get().await.lock().await;
|
||||
//ensure file is deleted, otherwise we would need to truncate the file which will not work with streaming
|
||||
//ensure the file is deleted first; otherwise we would need to truncate the file which will not work with streaming
|
||||
let _ = board
|
||||
.board_hal
|
||||
.get_esp()
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
use crate::fat_error::{FatError, FatResult};
|
||||
use crate::hal::{esp_time, PLANT_COUNT};
|
||||
use crate::log::{LogMessage, LOG_ACCESS};
|
||||
use crate::log::LogMessage;
|
||||
use crate::plant_state::{MoistureSensorState, PlantState};
|
||||
use crate::tank::determine_tank_state;
|
||||
use crate::{get_version, BOARD_ACCESS};
|
||||
@@ -11,7 +11,6 @@ use chrono_tz::Tz;
|
||||
use core::str::FromStr;
|
||||
use edge_http::io::server::Connection;
|
||||
use embedded_io_async::{Read, Write};
|
||||
use log::info;
|
||||
use serde::Serialize;
|
||||
|
||||
#[derive(Serialize, Debug)]
|
||||
|
||||
Reference in New Issue
Block a user