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

Function enqueue

chirpstack/src/downlink/multicast.rs:261–280  ·  view source on GitHub ↗
(qi: multicast::MulticastGroupQueueItem)

Source from the content-addressed store, hash-verified

259}
260
261pub async fn enqueue(qi: multicast::MulticastGroupQueueItem) -> Result<u32> {
262 // Try first to get configured gateways for multicast-group.
263 let mut gateway_ids = multicast::get_gateway_ids(&qi.multicast_group_id).await?;
264
265 // Fallback to automatic gateway-set detection.
266 if gateway_ids.is_empty() {
267 // get deveuis for multicast-group
268 let dev_euis = multicast::get_dev_euis(&qi.multicast_group_id).await?;
269
270 // get gateway history
271 let dev_gw_history = device::get_gateway_history_for_dev_euis(&dev_euis).await?;
272
273 // get minimum gateway set to cover all devices
274 gateway_ids = get_minimum_gateway_set(&dev_gw_history)?;
275 }
276
277 // Enqueue multicast downlink for the given gw set.
278 let (_, f_cnt) = multicast::enqueue(qi, &gateway_ids).await?;
279 Ok(f_cnt)
280}
281
282fn get_minimum_gateway_set(
283 dev_gw_history: &HashMap<EUI64, Vec<internal::GatewayRxInfoHistory>>,

Callers

nothing calls this directly

Calls 4

get_gateway_idsFunction · 0.85
get_dev_euisFunction · 0.85
get_minimum_gateway_setFunction · 0.85

Tested by

no test coverage detected