(
&self,
mac_version: MACVersion,
conf_f_cnt: u32,
tx_dr: u8,
tx_ch: u8,
f_nwk_s_int_key: &AES128Key,
s_nwk_s_int_key: &AES128Key,
)
| 583 | /// be left blank for LoRaWAN 1.0. |
| 584 | #[cfg(feature = "crypto")] |
| 585 | pub fn validate_uplink_data_mic( |
| 586 | &self, |
| 587 | mac_version: MACVersion, |
| 588 | conf_f_cnt: u32, |
| 589 | tx_dr: u8, |
| 590 | tx_ch: u8, |
| 591 | f_nwk_s_int_key: &AES128Key, |
| 592 | s_nwk_s_int_key: &AES128Key, |
| 593 | ) -> Result<bool> { |
| 594 | if let Some(mic) = self.mic { |
| 595 | return Ok(mic |
| 596 | == self.calculate_uplink_data_mic( |
| 597 | mac_version, |
| 598 | conf_f_cnt, |
| 599 | tx_dr, |
| 600 | tx_ch, |
| 601 | f_nwk_s_int_key, |
| 602 | s_nwk_s_int_key, |
| 603 | )?); |
| 604 | } |
| 605 | |
| 606 | Ok(false) |
| 607 | } |
| 608 | |
| 609 | /// Set the MIC for downlink data frames. |
| 610 | /// The conf_f_cnt is only required for LoRaWAN 1.1 and can be left blank for LoRaWAN 1.0. |
no test coverage detected