mirror of
https://github.com/meshtastic/firmware.git
synced 2025-05-09 06:41:59 +00:00
Rate limit waypoints and alerts and increase to allow every 10 seconds instead of 5 (#6699)
* Rate limit waypoints and alerts and increase to allow every 10 seconds instead of 5. * Update src/mesh/PhoneAPI.cpp Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Doot --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
parent
a7ef9e9c08
commit
e0b1fdb5e8
@ -6,6 +6,7 @@
|
||||
#define ONE_MINUTE_MS 60 * 1000
|
||||
#define THIRTY_SECONDS_MS 30 * 1000
|
||||
#define FIVE_SECONDS_MS 5 * 1000
|
||||
#define TEN_SECONDS_MS 10 * 1000
|
||||
|
||||
#define min_default_telemetry_interval_secs 30 * 60
|
||||
#define default_gps_update_interval IF_ROUTER(ONE_DAY, 2 * 60)
|
||||
|
@ -649,8 +649,10 @@ bool PhoneAPI::handleToRadioPacket(meshtastic_MeshPacket &p)
|
||||
meshtastic_QueueStatus qs = router->getQueueStatus();
|
||||
service->sendQueueStatusToPhone(qs, 0, p.id);
|
||||
return false;
|
||||
} else if (p.decoded.portnum == meshtastic_PortNum_POSITION_APP && lastPortNumToRadio[p.decoded.portnum] &&
|
||||
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], FIVE_SECONDS_MS)) {
|
||||
} else if (IS_ONE_OF(meshtastic_PortNum_POSITION_APP, meshtastic_PortNum_WAYPOINT_APP, meshtastic_PortNum_ALERT_APP) &&
|
||||
lastPortNumToRadio[p.decoded.portnum] &&
|
||||
Throttle::isWithinTimespanMs(lastPortNumToRadio[p.decoded.portnum], TEN_SECONDS_MS)) {
|
||||
// TODO: [Issue #6700] Make this rate limit throttling scale up / down with the preset
|
||||
LOG_WARN("Rate limit portnum %d", p.decoded.portnum);
|
||||
meshtastic_QueueStatus qs = router->getQueueStatus();
|
||||
service->sendQueueStatusToPhone(qs, 0, p.id);
|
||||
|
Loading…
Reference in New Issue
Block a user