From 3b89a3a396b1e309ce374f51b12f06770cf7f41c Mon Sep 17 00:00:00 2001 From: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com> Date: Wed, 9 Oct 2024 12:05:59 +0200 Subject: [PATCH] update sdk Signed-off-by: Jan Zachmann <50990105+JanZachmann@users.noreply.github.com> --- Cargo.lock | 5 +++-- Cargo.toml | 5 ++++- src/twin/modem_info.rs | 8 ++++---- src/twin/network_status.rs | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 99c942c..6deec67 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -632,14 +632,15 @@ dependencies = [ [[package]] name = "azure-iot-sdk" -version = "0.13.4" -source = "git+https://github.com/omnect/azure-iot-sdk.git?tag=0.13.4#e74da32a23fd24a0e8f28e72f80dc9e25a282e99" +version = "0.13.5" +source = "git+https://github.com/janzachmann/azure-iot-sdk.git?branch=main#171303f561c5843884237234fbd4a6b68318ec89" dependencies = [ "anyhow", "azure-iot-sdk-sys", "eis-utils", "futures", "log", + "rand", "serde_json", "tokio", "url", diff --git a/Cargo.toml b/Cargo.toml index 277936c..75b8cf6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,7 +15,10 @@ actix-server = "2.3" actix-web = "4.5" anyhow = "1.0" async-trait = "0.1" -azure-iot-sdk = { git = "https://github.com/omnect/azure-iot-sdk.git", tag = "0.13.4", features = [ +#azure-iot-sdk = { git = "https://github.com/omnect/azure-iot-sdk.git", tag = "0.13.4", features = [ +# "module_client", +#] } +azure-iot-sdk = { git = "https://github.com/janzachmann/azure-iot-sdk.git", branch = "main", features = [ "module_client", ] } cfg-if = "1.0" diff --git a/src/twin/modem_info.rs b/src/twin/modem_info.rs index 2cfd79d..eeb650e 100644 --- a/src/twin/modem_info.rs +++ b/src/twin/modem_info.rs @@ -3,7 +3,7 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use azure_iot_sdk::client::IotMessage; use lazy_static::lazy_static; -use log::info; +use log::{debug, info}; use serde_json::json; use std::{any::Any, env, time::Duration}; use tokio::{ @@ -152,7 +152,7 @@ mod inner { } pub async fn report(&mut self, force: bool) -> Result<()> { - info!("modem info status requested"); + debug!("report (force={force})"); let modem_reports = join_all( self.modem_paths() @@ -302,7 +302,7 @@ mod inner { } pub async fn report(&self, force: bool) -> Result<()> { - info!("modem info status requested"); + debug!("report"); self.ensure()?; @@ -385,7 +385,7 @@ impl Feature for ModemInfo { } async fn refresh(&mut self) -> Result<()> { - info!("modem_info requested"); + info!("refresh"); self.ensure()?; diff --git a/src/twin/network_status.rs b/src/twin/network_status.rs index 0440194..46aafe3 100644 --- a/src/twin/network_status.rs +++ b/src/twin/network_status.rs @@ -5,7 +5,7 @@ use anyhow::{Context, Result}; use async_trait::async_trait; use azure_iot_sdk::client::IotMessage; use lazy_static::lazy_static; -use log::{error, warn}; +use log::{debug, error, warn}; use serde::Serialize; use serde_json::json; use std::{any::Any, env, time::Duration}; @@ -107,6 +107,8 @@ impl NetworkStatus { const ID: &'static str = "network_status"; async fn report(&mut self, force: bool) -> Result<()> { + debug!("report (force={force})"); + let interfaces = Self::parse_interfaces(&networkd::networkd_interfaces().await?)?; // only report on change