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

Method start_pr_sessions

chirpstack/src/uplink/data_fns.rs:75–102  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

73 }
74
75 async fn start_pr_sessions(&mut self) -> Result<()> {
76 // Skip this step when we already have active sessions.
77 if !self.pr_device_sessions.is_empty() {
78 return Ok(());
79 }
80
81 let net_ids = roaming::get_net_ids_for_dev_addr(self.mac_payload.fhdr.devaddr);
82
83 trace!(net_ids = ?net_ids, "Got NetIDs");
84
85 for net_id in net_ids {
86 let ds = match self.start_pr_session(net_id).await {
87 Ok(v) => v,
88 Err(e) => {
89 error!(net_id = %net_id, error = %e.full(), "Start passive-roaming error");
90 continue;
91 }
92 };
93
94 // No need to store the device-session or call XmitDataReq when
95 // lifetime is not set (stateless passive-roaming).
96 if ds.lifetime.is_some() {
97 self.pr_device_sessions.push(ds);
98 }
99 }
100
101 Ok(())
102 }
103
104 async fn forward_uplink_for_sessions(&self) -> Result<()> {
105 trace!("Forwarding uplink for passive-roaming sessions");

Callers 1

_handleMethod · 0.80

Calls 3

get_net_ids_for_dev_addrFunction · 0.85
start_pr_sessionMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected