beast: refuse invalid crc
This commit is contained in:
parent
1c1fe5cfe4
commit
360ced4e7f
|
@ -169,14 +169,15 @@ impl Aircrafts {
|
||||||
while let Some(frame) = rx.recv().await {
|
while let Some(frame) = rx.recv().await {
|
||||||
match frame.parse_adsb() {
|
match frame.parse_adsb() {
|
||||||
Some(adsb_deku::Frame { df: adsb_deku::DF::ADSB(adsb), crc }) => {
|
Some(adsb_deku::Frame { df: adsb_deku::DF::ADSB(adsb), crc }) => {
|
||||||
if crc != 0 {
|
if crc == 0 {
|
||||||
|
state.write().unwrap()
|
||||||
|
.entry(adsb.icao)
|
||||||
|
.or_default()
|
||||||
|
.write().unwrap()
|
||||||
|
.update(adsb.me);
|
||||||
|
} else {
|
||||||
eprintln!("crc: {:02X}", crc);
|
eprintln!("crc: {:02X}", crc);
|
||||||
}
|
}
|
||||||
state.write().unwrap()
|
|
||||||
.entry(adsb.icao)
|
|
||||||
.or_default()
|
|
||||||
.write().unwrap()
|
|
||||||
.update(adsb.me);
|
|
||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue