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

Method send_tx_ack_event_relayed

chirpstack/src/downlink/tx_ack.rs:528–575  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

526 }
527
528 async fn send_tx_ack_event_relayed(&self) -> Result<()> {
529 trace!("Sending relayed tx ack event");
530
531 let tenant = self.tenant_relayed.as_ref().unwrap();
532 let app = self.application_relayed.as_ref().unwrap();
533 let dp = self.device_profile_relayed.as_ref().unwrap();
534 let dev = self.device_relayed.as_ref().unwrap();
535 let qi = self.device_queue_item.as_ref().unwrap();
536
537 let mut tags = (*dp.tags).clone();
538 tags.extend((*dev.tags).clone());
539
540 let downlink_id = self.downlink_frame.as_ref().unwrap().downlink_id;
541 let gateway_id = self
542 .downlink_frame
543 .as_ref()
544 .unwrap()
545 .downlink_frame
546 .as_ref()
547 .unwrap()
548 .gateway_id
549 .clone();
550
551 let pl = integration_pb::TxAckEvent {
552 downlink_id,
553 time: Some(Utc::now().into()),
554 device_info: Some(integration_pb::DeviceInfo {
555 tenant_id: tenant.id.to_string(),
556 tenant_name: tenant.name.clone(),
557 application_id: app.id.to_string(),
558 application_name: app.name.to_string(),
559 device_profile_id: dp.id.to_string(),
560 device_profile_name: dp.name.clone(),
561 device_name: dev.name.clone(),
562 device_class_enabled: dev.enabled_class.to_proto().into(),
563 dev_eui: dev.dev_eui.to_string(),
564 tags,
565 }),
566 queue_item_id: qi.id.to_string(),
567 f_cnt_down: qi.f_cnt_down.unwrap_or(0) as u32,
568 gateway_id,
569 tx_info: self.downlink_frame_item.as_ref().unwrap().tx_info.clone(),
570 };
571
572 integration::txack_event(app.id.into(), &dev.variables, &pl).await;
573
574 Ok(())
575 }
576
577 fn decode_phy_payload(&mut self) -> Result<()> {
578 trace!("Decoding PhyPayload");

Callers 1

_handle_relayedMethod · 0.80

Calls 6

unwrapMethod · 0.80
as_refMethod · 0.80
to_stringMethod · 0.80
to_protoMethod · 0.80
txack_eventFunction · 0.50
intoMethod · 0.45

Tested by

no test coverage detected