(&mut self)
| 777 | } |
| 778 | |
| 779 | async fn handle_mac_commands(&mut self) -> Result<()> { |
| 780 | trace!("Handling uplink mac-commands"); |
| 781 | |
| 782 | if let lrwn::Payload::MACPayload(pl) = &self.phy_payload.payload { |
| 783 | if !(*pl.fhdr.f_opts).is_empty() { |
| 784 | trace!("Mac-commands in f_opts"); |
| 785 | let (mac_response, must_send_downlink) = maccommand::handle_uplink( |
| 786 | &self.uplink_frame_set, |
| 787 | &pl.fhdr.f_opts, |
| 788 | self.tenant.as_ref().unwrap(), |
| 789 | self.application.as_ref().unwrap(), |
| 790 | self.device_profile.as_ref().unwrap(), |
| 791 | self.device.as_mut().unwrap(), |
| 792 | self.region_conf.as_ref().unwrap().clone(), |
| 793 | ) |
| 794 | .await |
| 795 | .context("Handle uplink mac-commands")?; |
| 796 | |
| 797 | self.must_send_downlink = must_send_downlink; |
| 798 | self.downlink_mac_commands = mac_response; |
| 799 | } |
| 800 | |
| 801 | if let Some(lrwn::FRMPayload::MACCommandSet(v)) = &pl.frm_payload { |
| 802 | trace!("Mac-commands in frmPayload"); |
| 803 | let (mac_response, must_send_downlink) = maccommand::handle_uplink( |
| 804 | &self.uplink_frame_set, |
| 805 | v, |
| 806 | self.tenant.as_ref().unwrap(), |
| 807 | self.application.as_ref().unwrap(), |
| 808 | self.device_profile.as_ref().unwrap(), |
| 809 | self.device.as_mut().unwrap(), |
| 810 | self.region_conf.as_ref().unwrap().clone(), |
| 811 | ) |
| 812 | .await |
| 813 | .context("Handle uplink mac-commands")?; |
| 814 | |
| 815 | self.must_send_downlink = must_send_downlink; |
| 816 | self.downlink_mac_commands = mac_response; |
| 817 | } |
| 818 | } |
| 819 | |
| 820 | Ok(()) |
| 821 | } |
| 822 | |
| 823 | fn append_meta_data_to_uplink_history(&mut self) -> Result<()> { |
| 824 | let ds = self.device.as_mut().unwrap().get_device_session_mut()?; |
no test coverage detected