mirror of
https://github.com/EFForg/rayhunter.git
synced 2026-04-28 00:20:00 -07:00
config: rename display to device
Because we toggle some ioctl settings based on this field, change the name to better capture that we're selecting which device we want to load settings for, not just the display module to load. This creates room for future per-device settings without needing more config file fields.
This commit is contained in:
committed by
Will Greenberg
parent
841bc7b015
commit
e239653a44
@@ -13,7 +13,7 @@ use std::net::SocketAddr;
|
||||
use std::sync::Arc;
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
|
||||
use crate::config::{Display, parse_args, parse_config};
|
||||
use crate::config::{Device, parse_args, parse_config};
|
||||
use crate::diag::run_diag_read_thread;
|
||||
use crate::error::RayhunterError;
|
||||
use crate::pcap::get_pcap;
|
||||
@@ -215,7 +215,8 @@ async fn run_with_config(
|
||||
if !config.debug_mode {
|
||||
let (ui_shutdown_tx, ui_shutdown_rx) = oneshot::channel();
|
||||
maybe_ui_shutdown_tx = Some(ui_shutdown_tx);
|
||||
let mut dev = DiagDevice::new(config.display == Display::Tplink)
|
||||
info!("Using configuration for device: {0:?}", config.device);
|
||||
let mut dev = DiagDevice::new(config.device == Device::Tplink)
|
||||
.await
|
||||
.map_err(RayhunterError::DiagInitError)?;
|
||||
dev.config_logs()
|
||||
@@ -234,13 +235,11 @@ async fn run_with_config(
|
||||
);
|
||||
info!("Starting UI");
|
||||
|
||||
let display = &config.display;
|
||||
info!("Display type {display:?}");
|
||||
let update_ui = match display {
|
||||
Display::Orbic => display::orbic::update_ui,
|
||||
Display::Tplink => display::tplink::update_ui,
|
||||
Display::Tmobile => display::tmobile::update_ui,
|
||||
Display::Wingtech => display::wingtech::update_ui,
|
||||
let update_ui = match &config.device {
|
||||
Device::Orbic => display::orbic::update_ui,
|
||||
Device::Tplink => display::tplink::update_ui,
|
||||
Device::Tmobile => display::tmobile::update_ui,
|
||||
Device::Wingtech => display::wingtech::update_ui,
|
||||
};
|
||||
update_ui(&task_tracker, &config, ui_shutdown_rx, ui_update_rx);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user