(&mut self)
| 373 | } |
| 374 | |
| 375 | fn set_tx_info(&mut self) -> Result<()> { |
| 376 | let mut prefer_rx2_over_rx1 = self._prefer_rx2_dr()?; |
| 377 | if self.network_conf.rx2_prefer_on_link_budget { |
| 378 | prefer_rx2_over_rx1 = prefer_rx2_over_rx1 || self._prefer_rx2_link_budget()?; |
| 379 | } |
| 380 | |
| 381 | // RX2 is prefered and the RX window is set to automatic. |
| 382 | if prefer_rx2_over_rx1 && self.network_conf.rx_window == 0 { |
| 383 | // RX2 |
| 384 | self.set_tx_info_for_rx2()?; |
| 385 | |
| 386 | // RX1 |
| 387 | self.set_tx_info_for_rx1()?; |
| 388 | } else { |
| 389 | // RX1 |
| 390 | if [0, 1].contains(&self.network_conf.rx_window) { |
| 391 | self.set_tx_info_for_rx1()?; |
| 392 | } |
| 393 | |
| 394 | // RX2 |
| 395 | if [0, 2].contains(&self.network_conf.rx_window) { |
| 396 | self.set_tx_info_for_rx2()?; |
| 397 | } |
| 398 | } |
| 399 | |
| 400 | Ok(()) |
| 401 | } |
| 402 | |
| 403 | fn set_tx_info_relayed(&mut self) -> Result<()> { |
| 404 | let mut prefer_rx2_over_rx1 = self._prefer_rx2_dr()?; |
no test coverage detected