mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-03 02:36:11 +00:00
fix: wire NearbyScreen ping through expected_ack_table so RTT is measurable
Direct sendMessage() calls bypass the BT serial handler that populates expected_ack_table; add registerExpectedAck() to MyMesh and call it from NearbyScreen so isAckPending() can actually track the outstanding ping. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
11cb0ae25e
commit
d59687647f
@@ -176,6 +176,14 @@ public:
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void registerExpectedAck(uint32_t expected_ack) {
|
||||||
|
if (!expected_ack) return;
|
||||||
|
expected_ack_table[next_ack_idx].msg_sent = millis();
|
||||||
|
expected_ack_table[next_ack_idx].ack = expected_ack;
|
||||||
|
expected_ack_table[next_ack_idx].contact = nullptr;
|
||||||
|
next_ack_idx = (next_ack_idx + 1) % EXPECTED_ACK_TABLE_SIZE;
|
||||||
|
}
|
||||||
|
|
||||||
#if ENV_INCLUDE_GPS == 1
|
#if ENV_INCLUDE_GPS == 1
|
||||||
void applyGpsPrefs() {
|
void applyGpsPrefs() {
|
||||||
sensors.setSettingValue("gps", _prefs.gps_enabled ? "1" : "0");
|
sensors.setSettingValue("gps", _prefs.gps_enabled ? "1" : "0");
|
||||||
|
|||||||
@@ -298,6 +298,7 @@ public:
|
|||||||
uint32_t expected_ack, est_timeout;
|
uint32_t expected_ack, est_timeout;
|
||||||
int res = the_mesh.sendMessage(ci, rtc_clock.getCurrentTime(), 0, "", expected_ack, est_timeout);
|
int res = the_mesh.sendMessage(ci, rtc_clock.getCurrentTime(), 0, "", expected_ack, est_timeout);
|
||||||
if (res != MSG_SEND_FAILED && expected_ack != 0) {
|
if (res != MSG_SEND_FAILED && expected_ack != 0) {
|
||||||
|
the_mesh.registerExpectedAck(expected_ack);
|
||||||
_ping_expected_ack = expected_ack;
|
_ping_expected_ack = expected_ack;
|
||||||
_ping_start_ms = millis();
|
_ping_start_ms = millis();
|
||||||
_ping_ack_seen = false;
|
_ping_ack_seen = false;
|
||||||
|
|||||||
Reference in New Issue
Block a user