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

Function handle

chirpstack/src/adr/mod.rs:57–80  ·  view source on GitHub ↗
(algo_id: &str, req: &Request)

Source from the content-addressed store, hash-verified

55}
56
57pub async fn handle(algo_id: &str, req: &Request) -> Response {
58 let algos = ADR_ALGORITHMS.read().await;
59 match algos.get(algo_id) {
60 Some(v) => match v.handle(req).await {
61 Ok(v) => v,
62 Err(e) => {
63 warn!(algorithm_id = %algo_id, error = %e, "ADR algorithm returned error");
64 Response {
65 dr: req.dr,
66 tx_power_index: req.tx_power_index,
67 nb_trans: req.nb_trans,
68 }
69 }
70 },
71 None => {
72 warn!(algorithm_id = %algo_id, "No ADR algorithm configured with given ID");
73 Response {
74 dr: req.dr,
75 tx_power_index: req.tx_power_index,
76 nb_trans: req.nb_trans,
77 }
78 }
79 }
80}
81
82#[async_trait]
83pub trait Handler {

Callers 10

_request_adr_changeMethod · 0.50
test_class_bFunction · 0.50
_handle_xmit_data_reqFunction · 0.50
start_roamingMethod · 0.50
handle_uplinkFunction · 0.50
message_callbackFunction · 0.50

Calls 2

getMethod · 0.45
handleMethod · 0.45

Tested by 1

test_class_bFunction · 0.40