Added ECHO cmd and fixed some timing issues

This commit is contained in:
2026-06-06 17:44:40 +02:00
parent 35ce1476d8
commit ac223ada72
29 changed files with 1182 additions and 152 deletions
+19
View File
@@ -24,12 +24,27 @@ enum EspNowMessageType {
ESPNOW_BATTERY_REPORT = 16;
ESPNOW_SET_TAP_NOTIFY = 17;
ESPNOW_TAP_EVENT = 18;
ESPNOW_ECHO_PING = 19;
ESPNOW_ECHO_PONG = 20;
}
message EspNowUnicastTest {
uint32 seq = 1;
}
/** Master → slave: echo ping (host ts + master monotonic time for RTT). */
message EspNowEchoPing {
uint64 host_timestamp_us = 1;
/** esp_timer_get_time() (µs since boot) when master forwarded this message. */
uint64 master_time_us = 2;
}
/** Slave → master: echo ping payload unchanged. */
message EspNowEchoPong {
uint64 host_timestamp_us = 1;
uint64 master_time_us = 2;
}
/** Master → slave: locate pod (LED ring R/G/B ×3 @ full brightness). */
message EspNowFindMe {
/** 0 = any slave; otherwise only slave_id must match */
@@ -43,6 +58,8 @@ message EspNowRestart {
message EspNowDiscover {
uint32 network = 1;
/** Master is in an OTA session (UART upload or ESP-NOW distribution). */
bool master_ota_pending = 2;
}
message EspNowSlavePresence {
@@ -158,5 +175,7 @@ message EspNowMessage {
EspNowBatteryReport battery_report = 17;
EspNowTapNotify tap_notify = 18;
EspNowTapEvent tap_event = 19;
EspNowEchoPing echo_ping = 20;
EspNowEchoPong echo_pong = 21;
}
}