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

Method select_downlink_gateway

chirpstack/src/downlink/join.rs:188–204  ·  view source on GitHub ↗
(&mut self)

Source from the content-addressed store, hash-verified

186 }
187
188 fn select_downlink_gateway(&mut self) -> Result<()> {
189 trace!("Select downlink gateway");
190 let ds = self.device.device_session.as_ref().unwrap();
191
192 let gw_down = helpers::select_downlink_gateway(
193 Some(self.tenant.id.into()),
194 &self.uplink_frame_set.region_config_id,
195 self.network_conf.gateway_prefer_min_margin,
196 &ds.gateway_rx_info_history,
197 true,
198 )?;
199
200 self.downlink_frame.gateway_id = hex::encode(&gw_down.gateway_id);
201 self.downlink_gateway = Some(gw_down);
202
203 Ok(())
204 }
205
206 fn set_tx_info(&mut self) -> Result<()> {
207 trace!("Setting tx-info");

Callers 2

_handleMethod · 0.45
_handle_relayedMethod · 0.45

Calls 5

select_downlink_gatewayFunction · 0.85
unwrapMethod · 0.80
as_refMethod · 0.80
encodeFunction · 0.50
intoMethod · 0.45

Tested by

no test coverage detected