(&mut self)
| 234 | } |
| 235 | |
| 236 | fn set_tx_info_relayed(&mut self) -> Result<()> { |
| 237 | trace!("Setting tx-info for relay"); |
| 238 | |
| 239 | let mut prefer_rx2_over_rx1 = self._prefer_rx2_dr()?; |
| 240 | if self.network_conf.rx2_prefer_on_link_budget { |
| 241 | prefer_rx2_over_rx1 = prefer_rx2_over_rx1 || self._prefer_rx2_link_budget()?; |
| 242 | } |
| 243 | |
| 244 | // RX2 is prefered and the RX window is set to automatic. |
| 245 | if prefer_rx2_over_rx1 && self.network_conf.rx_window == 0 { |
| 246 | // RX2 |
| 247 | self.set_tx_info_for_rx2_relayed()?; |
| 248 | |
| 249 | // RX1 |
| 250 | self.set_tx_info_for_rx1_relayed()?; |
| 251 | } else { |
| 252 | // RX1 |
| 253 | if [0, 1].contains(&self.network_conf.rx_window) { |
| 254 | self.set_tx_info_for_rx1_relayed()?; |
| 255 | } |
| 256 | |
| 257 | // RX2 |
| 258 | if [0, 2].contains(&self.network_conf.rx_window) { |
| 259 | self.set_tx_info_for_rx2_relayed()?; |
| 260 | } |
| 261 | } |
| 262 | |
| 263 | Ok(()) |
| 264 | } |
| 265 | |
| 266 | fn set_tx_info_for_rx1(&mut self) -> Result<()> { |
| 267 | trace!("Setting tx-info for RX1"); |
no test coverage detected