(&mut self, key: &AES128Key)
| 899 | /// This will automatically call decode_frm_payload. |
| 900 | #[cfg(feature = "crypto")] |
| 901 | pub fn decrypt_frm_payload(&mut self, key: &AES128Key) -> Result<()> { |
| 902 | if let Payload::MACPayload(pl) = &mut self.payload { |
| 903 | // nothing to do |
| 904 | if pl.frm_payload.is_none() { |
| 905 | return Ok(()); |
| 906 | } |
| 907 | |
| 908 | let uplink = is_uplink(self.mhdr.f_type); |
| 909 | let data = pl.frm_payload.as_ref().unwrap().to_vec()?; |
| 910 | let data = encrypt_frm_payload(key, uplink, &pl.fhdr.devaddr, pl.fhdr.f_cnt, &data)?; |
| 911 | |
| 912 | return decode_frm_payload(pl, uplink, pl.f_port.unwrap_or(0), data); |
| 913 | } |
| 914 | |
| 915 | Err(anyhow!("payload must be of type MACPayload")) |
| 916 | } |
| 917 | |
| 918 | #[cfg(feature = "crypto")] |
| 919 | fn calculate_uplink_data_mic( |
nothing calls this directly
no test coverage detected