(&mut self)
| 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"); |
no test coverage detected