FIXUP: more detailed printf logging
This commit is contained in:
parent
5735f18ee2
commit
1648a5eb0f
1 changed files with 20 additions and 5 deletions
25
src/main.rs
25
src/main.rs
|
|
@ -615,7 +615,6 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// info!("Received frame with {} bytes", frame.len);
|
// info!("Received frame with {} bytes", frame.len);
|
||||||
esp_println::print!("."); // TODO: debug only!
|
|
||||||
unsafe {
|
unsafe {
|
||||||
#[allow(static_mut_refs)]
|
#[allow(static_mut_refs)]
|
||||||
if let Some(ref mut led) = USER_LED.as_mut() {
|
if let Some(ref mut led) = USER_LED.as_mut() {
|
||||||
|
|
@ -636,6 +635,7 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
|
||||||
Ok(packet) => {
|
Ok(packet) => {
|
||||||
// drop hopped (for now)
|
// drop hopped (for now)
|
||||||
if packet.decoded.is_hopped() {
|
if packet.decoded.is_hopped() {
|
||||||
|
esp_println::print!("."); // TODO: debug only!
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -644,9 +644,15 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
|
||||||
// drop all unsupported message IDs and rate-limit SPATEMs
|
// drop all unsupported message IDs and rate-limit SPATEMs
|
||||||
if match message_id {
|
if match message_id {
|
||||||
#[cfg(feature = "denm")]
|
#[cfg(feature = "denm")]
|
||||||
c_its_parser::standards::extensions::ItsMessageId::Denm => false,
|
c_its_parser::standards::extensions::ItsMessageId::Denm => {
|
||||||
|
esp_println::print!("D"); // TODO: debug only!
|
||||||
|
false
|
||||||
|
}
|
||||||
#[cfg(feature = "cam")]
|
#[cfg(feature = "cam")]
|
||||||
c_its_parser::standards::extensions::ItsMessageId::Cam => false,
|
c_its_parser::standards::extensions::ItsMessageId::Cam => {
|
||||||
|
esp_println::print!("C"); // TODO: debug only!
|
||||||
|
false
|
||||||
|
}
|
||||||
#[cfg(feature = "spat")]
|
#[cfg(feature = "spat")]
|
||||||
c_its_parser::standards::extensions::ItsMessageId::Spatem => {
|
c_its_parser::standards::extensions::ItsMessageId::Spatem => {
|
||||||
// reduce SPAT rate per station ID
|
// reduce SPAT rate per station ID
|
||||||
|
|
@ -662,7 +668,10 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
|
||||||
i.msg_count = i.msg_count.wrapping_add(1);
|
i.msg_count = i.msg_count.wrapping_add(1);
|
||||||
|
|
||||||
if (i.msg_count % SPAT_RATE_LIMIT) > 0 {
|
if (i.msg_count % SPAT_RATE_LIMIT) > 0 {
|
||||||
|
esp_println::print!("s"); // TODO: debug only!
|
||||||
drop_msg = true;
|
drop_msg = true;
|
||||||
|
} else {
|
||||||
|
esp_println::print!("S"); // TODO: debug only!
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -670,8 +679,14 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
|
||||||
drop_msg
|
drop_msg
|
||||||
}
|
}
|
||||||
#[cfg(feature = "spat")]
|
#[cfg(feature = "spat")]
|
||||||
c_its_parser::standards::extensions::ItsMessageId::Mapem => false,
|
c_its_parser::standards::extensions::ItsMessageId::Mapem => {
|
||||||
_ => true,
|
esp_println::print!("M"); // TODO: debug only!
|
||||||
|
false
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
esp_println::print!("?"); // TODO: debug only!
|
||||||
|
true
|
||||||
|
}
|
||||||
} {
|
} {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue