mirror of
https://github.com/chirpstack/chirpstack.git
synced 2025-06-17 06:48:24 +00:00
Decode frm_payload mac-commands in device frame log.
This commit is contained in:
@ -288,6 +288,7 @@ impl Data {
|
||||
// The queue item should fit within the max payload size and should not be pending
|
||||
// already.
|
||||
if qi.data.len() <= max_payload_size && !qi.is_pending {
|
||||
trace!(id = %qi.id, more_in_queue = more_in_queue, "Found device queue-item for downlink");
|
||||
self.device_queue_item = Some(qi);
|
||||
self.more_device_queue_items = more_in_queue;
|
||||
return Ok(());
|
||||
@ -634,6 +635,7 @@ impl Data {
|
||||
.starts_with("1.1"),
|
||||
nwk_s_enc_key: self.device_session.nwk_s_enc_key.clone(),
|
||||
downlink_frame: Some(self.downlink_frame.clone()),
|
||||
n_f_cnt_down: self.device_session.n_f_cnt_down,
|
||||
..Default::default()
|
||||
})
|
||||
.await
|
||||
|
@ -433,6 +433,13 @@ impl TxAck {
|
||||
|
||||
let nwk_s_enc_key = AES128Key::from_slice(&df.nwk_s_enc_key)?;
|
||||
|
||||
if let Payload::MACPayload(pl) = &mut phy.payload {
|
||||
if pl.f_port.unwrap_or(0) == 0 {
|
||||
// We need to set the full NFcntDown to decrypt the mac-commands.
|
||||
pl.fhdr.f_cnt = df.n_f_cnt_down;
|
||||
}
|
||||
}
|
||||
|
||||
if let Payload::MACPayload(pl) = &phy.payload {
|
||||
// f_port must be either None or 0
|
||||
if pl.f_port.unwrap_or(0) == 0 {
|
||||
|
@ -283,6 +283,7 @@ pub async fn get_frame_logs(
|
||||
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
|
||||
if pl.plaintext_mac_commands {
|
||||
phy.decode_f_opts_to_mac_commands()?;
|
||||
phy.decode_frm_payload_to_mac_commands()?;
|
||||
}
|
||||
|
||||
let pl = api::LogItem {
|
||||
@ -314,6 +315,7 @@ pub async fn get_frame_logs(
|
||||
let mut phy = lrwn::PhyPayload::from_slice(&pl.phy_payload)?;
|
||||
if pl.plaintext_mac_commands {
|
||||
phy.decode_f_opts_to_mac_commands()?;
|
||||
phy.decode_frm_payload_to_mac_commands()?;
|
||||
}
|
||||
|
||||
let pl = api::LogItem {
|
||||
|
Reference in New Issue
Block a user