Watch
0
0
Fork
You've already forked esp32-c_its-companion
0

FIXUP: more detailed printf logging

This commit is contained in:
Jannik Beyerstedt 2026-08-05 11:43:04 +02:00 • committed by Jannik Beyerstedt
commit 706ca4a254

View file

@ -678,7 +678,6 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
}
// info!("Received frame with {} bytes", frame.len);
esp_println::print!("."); // TODO: debug only!
unsafe {
#[allow(static_mut_refs)]
if let Some(ref mut led) = USER_LED.as_mut() {
@ -699,6 +698,7 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
Ok(packet) => {
// drop hopped (for now)
if packet.decoded.is_hopped() {
esp_println::print!("."); // TODO: debug only!
return;
}
@ -707,9 +707,15 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
// drop all unsupported message IDs and rate-limit SPATEMs
if match message_id {
#[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")]
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")]
c_its_parser::standards::extensions::ItsMessageId::Spatem => {
// reduce SPAT rate per station ID
@ -725,7 +731,10 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
i.msg_count = i.msg_count.wrapping_add(1);
if (i.msg_count % SPAT_RATE_LIMIT) > 0 {
esp_println::print!("s"); // TODO: debug only!
drop_msg = true;
} else {
esp_println::print!("S"); // TODO: debug only!
}
});
}
@ -733,8 +742,14 @@ fn handle_frame(frame: esp_radio::wifi::sniffer::PromiscuousPkt<'_>) {
drop_msg
}
#[cfg(feature = "spat")]
c_its_parser::standards::extensions::ItsMessageId::Mapem => false,
_ => true,
c_its_parser::standards::extensions::ItsMessageId::Mapem => {
esp_println::print!("M"); // TODO: debug only!
false
}
_ => {
esp_println::print!("?"); // TODO: debug only!
true
}
} {
return;
}