Skip to content

Commit

Permalink
Explicitly filter out proprietary packets in check
Browse files Browse the repository at this point in the history
  • Loading branch information
madninja committed Aug 1, 2023
1 parent 6fcfa39 commit 3ff196a
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/packet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ impl PacketUp {
}

pub fn is_uplink(&self) -> bool {
Self::parse_frame(Direction::Uplink, self.payload()).is_ok()
// An uplinkable packet is a parseable lorawan uplink frame which is not
// a proprietary frame
Self::parse_frame(Direction::Uplink, self.payload())
.map(|frame| !matches!(frame, PHYPayloadFrame::Proprietary(_)))
.unwrap_or(false)
}

pub fn payload(&self) -> &[u8] {
Expand Down

0 comments on commit 3ff196a

Please sign in to comment.