(&self, uplink: bool, dr_index: u8)
| 565 | } |
| 566 | |
| 567 | fn get_data_rate(&self, uplink: bool, dr_index: u8) -> Result<DataRateModulation> { |
| 568 | for (i, dr) in &self.data_rates { |
| 569 | if uplink != dr.uplink && uplink == dr.downlink { |
| 570 | continue; |
| 571 | } |
| 572 | |
| 573 | if *i == dr_index { |
| 574 | return Ok(dr.modulation.clone()); |
| 575 | } |
| 576 | } |
| 577 | |
| 578 | Err(anyhow!( |
| 579 | "Unknown data-rate index, uplink {}, dr: {}", |
| 580 | uplink, |
| 581 | dr_index |
| 582 | )) |
| 583 | } |
| 584 | |
| 585 | fn get_new_channel_req_dr_range(&self, data_rates: &[u8]) -> Result<(u8, u8)> { |
| 586 | if data_rates.is_empty() { |
no outgoing calls
no test coverage detected