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

Method get_data_rate

lrwn/src/region/mod.rs:567–583  ·  view source on GitHub ↗
(&self, uplink: bool, dr_index: u8)

Source from the content-addressed store, hash-verified

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() {

Calls

no outgoing calls

Tested by

no test coverage detected