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

Method set_tx_info

chirpstack/src/downlink/join.rs:206–234  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

204 }
205
206 fn set_tx_info(&mut self) -> Result<()> {
207 trace!("Setting tx-info");
208
209 let mut prefer_rx2_over_rx1 = self._prefer_rx2_dr()?;
210 if self.network_conf.rx2_prefer_on_link_budget {
211 prefer_rx2_over_rx1 = prefer_rx2_over_rx1 || self._prefer_rx2_link_budget()?;
212 }
213
214 // RX2 is prefered and the RX window is set to automatic.
215 if prefer_rx2_over_rx1 && self.network_conf.rx_window == 0 {
216 // RX2
217 self.set_tx_info_for_rx2()?;
218
219 // RX1
220 self.set_tx_info_for_rx1()?;
221 } else {
222 // RX1
223 if [0, 1].contains(&self.network_conf.rx_window) {
224 self.set_tx_info_for_rx1()?;
225 }
226
227 // RX2
228 if [0, 2].contains(&self.network_conf.rx_window) {
229 self.set_tx_info_for_rx2()?;
230 }
231 }
232
233 Ok(())
234 }
235
236 fn set_tx_info_relayed(&mut self) -> Result<()> {
237 trace!("Setting tx-info for relay");

Callers 1

_handleMethod · 0.45

Calls 5

containsMethod · 0.80
_prefer_rx2_drMethod · 0.45
set_tx_info_for_rx2Method · 0.45
set_tx_info_for_rx1Method · 0.45

Tested by

no test coverage detected