MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / setup

Function setup

chirpstack/src/adr/mod.rs:21–44  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

19 LazyLock::new(|| RwLock::new(HashMap::new()));
20
21pub async fn setup() -> Result<()> {
22 info!("Setting up adr algorithms");
23 let mut algos = ADR_ALGORITHMS.write().await;
24
25 trace!("Setting up included algorithms");
26 let a = default::Algorithm::new();
27 algos.insert(a.get_id(), Box::new(a));
28
29 let a = lr_fhss::Algorithm::new();
30 algos.insert(a.get_id(), Box::new(a));
31
32 let a = lora_lr_fhss::Algorithm::new();
33 algos.insert(a.get_id(), Box::new(a));
34
35 trace!("Setting up plugins");
36 let conf = config::get();
37 for file_path in &conf.network.adr_plugins {
38 info!(file_path = %file_path, "Setting up ADR plugin");
39 let a = plugin::Plugin::new(file_path)?;
40 algos.insert(a.get_id(), Box::new(a));
41 }
42
43 Ok(())
44}
45
46pub async fn get_algorithms() -> HashMap<String, String> {
47 let mut out: HashMap<String, String> = HashMap::new();

Callers 15

test_handleFunction · 0.70
test_handleFunction · 0.70
prepareFunction · 0.50
test_fnsFunction · 0.50
test_snsFunction · 0.50
run_testFunction · 0.50
test_fns_uplinkFunction · 0.50
test_sns_uplinkFunction · 0.50
test_sns_dev_not_foundFunction · 0.50
run_testFunction · 0.50

Calls 3

insertMethod · 0.80
getFunction · 0.50
get_idMethod · 0.45

Tested by 12

test_handleFunction · 0.56
test_handleFunction · 0.56
prepareFunction · 0.40
test_fnsFunction · 0.40
test_snsFunction · 0.40
run_testFunction · 0.40
test_fns_uplinkFunction · 0.40
test_sns_uplinkFunction · 0.40
test_sns_dev_not_foundFunction · 0.40
run_testFunction · 0.40