Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 8 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 8 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,24 @@ http-body-util = "0"
hyper = { version = "1", features = ["full"] }
hyper-util = { version = "0", features = ["tokio"] }
log = "0"
lorawan-device = { git = "https://github.com/lora-rs/lora-rs.git", features = ["default-crypto", "serde"] }
#lorawan-device = { path = "../lora-rs/lorawan-device", features = ["default-crypto", "serde", "multicast"] }
lorawan-device = { version = ">=0.12.2", features = ["serde"] }
prometheus = "0"
rand_core = { version = "0.6", default-features = false, optional = true }
semtech-udp = { path = "../semtech-udp", features = ["client"] }#{ version = "0.11" }
semtech-udp = { version="0.12", features = ["client"] }
serde = "1"
structopt = "0"
thiserror = "1"
rand = "0"
triggered = "0"

[patch.crates-io]
lorawan-device = { git = "https://github.com/lora-rs/lora-rs.git", rev="a5e690a3f1f68c4e4c43efcd564467938c574ea3" }
lora-modulation = { git = "https://github.com/lora-rs/lora-rs.git", rev="a5e690a3f1f68c4e4c43efcd564467938c574ea3" }

[dependencies.tokio]
version = "1"
features = ["macros", "sync", "time", "rt-multi-thread", "signal"]

[features]
async-radio = ["rand_core"]
multicast = [ "lorawan-device/multicast" ]
async-radio = [ "rand_core/getrandom" ]
4 changes: 2 additions & 2 deletions src/async_virtual_device/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use lorawan_device::async_device::{
radio::{PhyRxTx, RxConfig, Timer},
Device, Downlink, JoinResponse, NetworkCredentials, SendResponse, Timings,
};
use lorawan_device::default_crypto::DefaultFactory;
use lorawan_device::region::Configuration;
use lorawan_device::{AppEui, AppKey, DevEui, JoinMode};
pub use semtech_udp::client_runtime::{ClientTx, DownlinkRequest};
Expand All @@ -27,7 +26,7 @@ pub struct VirtualDevice {
secs_between_transmits: u64,
secs_between_join_transmits: u64,
credentials: NetworkCredentials,
device: Device<VirtualRadio, DefaultFactory, VirtualTimer, rand_core::OsRng, 512, 4>,
device: Device<VirtualRadio, VirtualTimer, rand_core::OsRng, 512, 4>,
state: State,
}

Expand Down Expand Up @@ -62,6 +61,7 @@ impl VirtualDevice {
rand_core::OsRng,
);
device.enable_class_c();
#[cfg(feature = "multicast")]
device.set_multicast_ke_key(lorawan_device::async_device::McRootKey::from_str(
"3371C1F28C755A5D328DFDD6E01A32ED",
)?);
Expand Down
2 changes: 1 addition & 1 deletion src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ impl From<radio::RfConfig> for Settings {

impl Settings {
pub fn get_datr(&self) -> DataRate {
DataRate::new(self.rf_config.bb.sf.into(), self.rf_config.bb.bw.into())
DataRate::new(self.rf_config.bb.sf, self.rf_config.bb.bw)
}

pub fn get_codr(&self) -> CodingRate {
Expand Down
5 changes: 2 additions & 3 deletions src/virtual_device/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
use log::{debug, info, warn};
use lorawan_device::default_crypto::DefaultFactory as LorawanCrypto;
use lorawan_device::mac::NetworkCredentials;
use lorawan_device::region::Configuration;
use lorawan_device::{
Expand All @@ -19,7 +18,7 @@ mod udp_radio;

pub struct VirtualDevice {
label: String,
device: Device<UdpRadio, LorawanCrypto, rand::rngs::OsRng, 512>,
device: Device<UdpRadio, rand::rngs::OsRng, 512>,
receiver: mpsc::Receiver<IntermediateEvent>,
sender: mpsc::Sender<IntermediateEvent>,
metrics_sender: metrics::Sender,
Expand Down Expand Up @@ -57,7 +56,7 @@ impl VirtualDevice {
region: settings::Region,
) -> Result<(PacketSender, VirtualDevice)> {
let (radio, receiver, sender) = UdpRadio::new(time, client_tx).await;
let device: Device<UdpRadio, LorawanCrypto, rand::rngs::OsRng, 512> =
let device: Device<UdpRadio, rand::rngs::OsRng, 512> =
Device::new(Configuration::new(region.into()), radio, rand::rngs::OsRng);

Ok((
Expand Down