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